记录/Log4J 到数据库

发布于 2024-09-13 23:06:04 字数 520 浏览 3 评论 0原文

在我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

肩上的翅膀 2024-09-20 23:06:04

有人似乎编写了 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.

木森分化 2024-09-20 23:06:04

如果您想考虑独立的日志服务器,我推荐这个工具。它将通过套接字接受日志数据并保存它们。也适用于许多数据库品牌。设置非常简单。但它不是一个免费工具......

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...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文