简体   繁体   English

我如何使用和管理日志[Log4j] Java?

[英]how can i use and manage logs [Log4j] java?


I'm new in Framework's logging and i need your advice. 我是Framework 日志记录的新手,需要您的建议。
I develop a java EE application and i want to integrate logs in it, I see that I can use RollingFileAppender to save my logs in files. 我开发了一个Java EE应用程序,并且想在其中集成日志,我看到可以使用RollingFileAppender将日志保存在文件中。 But what i want to do is to manage those logs, filter them by categories and create a statistics. 但是我要做的是管理这些日志,按类别过滤它们并创建统计信息。 I know that if i use JDBCAppender i can do such things but this solution is not recommended because of using a lot of resources . 我知道,如果我使用JDBCAppender,我可以做这样的事情,但是由于使用大量资源,不建议使用此解决方案。 any recommended solution ? 任何建议的解决方案?

H-Raf H-拉夫

For Logging I would recommend to use SLF4j and try the new Log4J 2 binding . 对于日志记录,我建议使用SLF4j并尝试新的Log4J 2绑定

To analyse log files from several nodes there are tools such as Splunk (commercial) or GrayLog (Open Source with commercial support). 要分析来自多个节点的日志文件,可以使用诸如Splunk (商业)或GrayLog (具有商业支持的开源)之类的工具。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM