egg icon indicating copy to clipboard operation
egg copied to clipboard

请问如何在业务层里面自定义mysql日志?

Open xinnian1992 opened this issue 9 years ago • 13 comments

现在我公司需要记录错作者对数据库的增加,更新,删除的mysql原生语句到数据库!请问有没有方法实现,谢谢.............

xinnian1992 avatar Sep 29 '17 07:09 xinnian1992

这是用的哪个插件

popomore avatar Oct 09 '17 07:10 popomore

不晓得,现在就是不晓得怎么办,求解决之法

xinnian1992 avatar Oct 17 '17 01:10 xinnian1992

问的是,你用哪一个插件来操作 mysql

atian25 avatar Oct 17 '17 01:10 atian25

就是eggjs自带的mysql

xinnian1992 avatar Oct 17 '17 02:10 xinnian1992

@atian25 那个得去改ali-rds 那边用的是debug来输出到终端

solarhell avatar Oct 17 '17 02:10 solarhell

https://github.com/eggjs/egg/issues/1512

popomore avatar Oct 17 '17 02:10 popomore

我不是要输出到终端,我想把mysql的插入,更新,删除这些重要的mysql原生语句插入到数据库

xinnian1992 avatar Oct 17 '17 02:10 xinnian1992

从而来记录数据库重要日志

xinnian1992 avatar Oct 17 '17 02:10 xinnian1992

@atian25

xinnian1992 avatar Oct 17 '17 02:10 xinnian1992

能输出,就能 tranform 到其他存储。

就目前而言,先自己在 Service 包一下吧。

atian25 avatar Oct 17 '17 02:10 atian25

可以用 egg-knex,执行后通过 query 事件去拿,具体看 knexjs 文档。

xinnian1992 [email protected] 于 2017年9月29日周五 下午3:39写道:

现在我公司需要记录错作者对数据库的增加,更新,删除的mysql原生语句到数据库!请问有没有方法实现,谢谢.............

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/eggjs/egg/issues/1478, or mute the thread https://github.com/notifications/unsubscribe-auth/ABHhMo4O2L1bPwi_IyUCFmHhb4ce5OPkks5snJ6dgaJpZM4PoTh0 .

sunfuze avatar Oct 17 '17 13:10 sunfuze

谢谢,我试一下

xinnian1992 avatar Oct 24 '17 09:10 xinnian1992

@sunfuze

xinnian1992 avatar Oct 24 '17 09:10 xinnian1992