是否可以使用 JCL 创建多个日志文件?
我正在尝试将特定操作的结果保存在应用程序的服务器端,以便我可以将日志用于挖掘目的。在运行时将每个操作的结果发送到数据库会导致过多的事务负载。所以我想先将它们保存为日志,并定期将日志文件转储到数据库中。该应用程序使用 jcl 进行日志记录。但是,我在 jcl 中找不到任何解决方案。是否可以?为此目的的任何其他想法也将非常感激。
I am trying to save the results of a specific action in the server side of my application so that i can use the logs for mining purposes. To send the results to db in runtime for each action causes too much transaction load. So I want to save them first as logs and dump the log files into database periodically. The application uses jcl for logging. However, i could not find any solution for this in jcl. Is it possible? Also any other idea for this purpose will be really appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我可以建议你使用 SLF4J 和 logback 吗? Logback 有 RollingFileAppender 可以解决您的任务。 Logback 有 SLF4J 的本机绑定
Can I suggest you to go for SLF4J and logback? Logback has RollingFileAppender that can solve your task. Logback has a native binding for SLF4J
JCL(Jakarta Commons Logging)不是日志记录实现,它只是一个 API。它委托给幕后的“真实”记录器,例如 java.util.logging 或 log4j。这就是您需要配置的内容,以便按照您想要的方式处理日志文件。
JCL (Jakarta Commons Logging) isn't a logging implementation, it's just an API. It delegates to an "real" logger behind the scenes such as
java.util.logging
or log4j. That's what you need to configure to get your log file handling the way you want it.