记录/Log4J 到数据库
在我的 Grails 应用程序中,我异步运行一些批处理进程,并希望该进程记录各种状态消息,以便管理员稍后可以检查它们。
我认为使用 log4j JDBC 附加程序作为最简单的解决方案,但据我所知它不使用 DataSource。有人让它工作或者编写了自己的 Grails DB Appender 吗?
有人有类似的需求吗?你是如何实现的?
我可以创建一个 Job 的概念,它有许多 LoggingMessages,但我想也许有一个标准方法或一个插件可以做到这一点。
PS 几周前有过一次相关的讨论,但那是关于与我需要的不同的方面。 http://grails.1312388.n4。 nabble.com/Async-Event-that-publishes-progress-td2303653.html
In my Grails application, I run some batch processes asynchronously, and would like the process to log various status messages so that the administrator later can examine them.
I thought of using log4j JDBC appender as the simplest solution, but from what I can tell it doesn't use DataSource. Has anybody gotten it to work or wrote their own Grails DB Appender?
Did anybody have a similar requirement, and how did you implement it?
I can create a notion of Job, which hasMany LoggingMessages, but thought perhaps there is a standard way or a plugin that does this.
P.S. There was a somewhat related discussion a few weeks ago, but that one was about a different aspect than what I need.
http://grails.1312388.n4.nabble.com/Async-Event-that-publishes-progress-td2303653.html
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有人似乎编写了 log4j JDBC 附加程序的一个版本,它确实使用了数据源并添加了一些其他不错的功能。请查看作者的博客条目。
Someone seems to have written a version of the log4j JDBC appender that does use a datasource and adds some other nice features. Have a look at this blog entry by the author.
如果您想考虑独立的日志服务器,我推荐这个工具。它将通过套接字接受日志数据并保存它们。也适用于许多数据库品牌。设置非常简单。但它不是一个免费工具......
If you want to consider stand alone log server, I'd recommend this tool. It would accept log data over sockets and persist them. Works with many database brands too. Very simple to set up. It's not a free tool though...