简体   繁体   English

自定义JBOSS 6.2 EAP日志记录

[英]Customizing JBOSS 6.2 EAP logging

Developing a web application using JBOSS 6.2 EAP as the Application server. 使用JBOSS 6.2 EAP作为应用程序服务器开发Web应用程序。 Trying to customize the the logging. 尝试自定义日志记录。 Want to create different logs for different modules in specified locations. 想要为指定位置的不同模块创建不同的日志。

Did some home work and tried to add 做一些家庭作业,并尝试添加

periodic-rotating-file-handler name="FOO_BAR_FILE">
    <formatter>
        <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
    </formatter>
    <file relative-to="jboss.server.log.dir" path="foo_bar_file.log"/>
    <suffix value=".yyyy-MM-dd"/>
    <append value="true"/>
</periodic-rotating-file-handler>

in the profile section of standalone.xml 在standalone.xml的配置文件部分中

and added the logger also in the same file 并将记录器也添加到同一文件中

<logger category="com..org.Commets">
    <level name="INFO"/>
    <handlers>
        <handler name="FOO_BAR_FILE"/>
    </handlers>
</logger>

Also, cant able to find the log4j.xml in the jboss folder. 另外,无法在jboss文件夹中找到log4j.xml。 New to JBoss , guess missing something or going in the wrong way. JBoss的新手,猜测丢失了某些东西或以错误的方式进行操作。 Can somebody help in this. 有人可以帮忙吗?

JBoss EAP 6.x does not use log4j. JBoss EAP 6.x不使用log4j。 It uses JBoss Log Manager which is an extension of JUL 它使用JBoss Log Manager,它是JUL的扩展

With regards to your configuration what you have should work just fine. 关于您的配置,您应该可以正常工作。 Assuming of course you have a category named com..org.Comments . 当然,假设您有一个名为com..org.Comments的类别。

If you want each deployment to have their own logging configuration have a look at per-deployment logging or logging profiles . 如果希望每个部署都有自己的日志记录配置,请查看每个部署的日志记录日志记录配置文件

If you are trying to configure logging in JBoss and not in the deployment descriptor of the application you are deploying, then I think you will also need to set the host property org.jboss.as.logging.per-deployment=false. 如果您尝试在JBoss中而不是在要部署的应用程序的部署描述符中配置日志记录,那么我认为您还需要设置主机属性org.jboss.as.logging.per-deployment = false。 This tells JBoss to use the server logging config and not the application logging config. 这告诉JBoss使用服务器日志记录配置而不是应用程序日志记录配置。

And I think JBoss does support Log4J, at least according to page 340 of the following JBoss Admin Doc: Administration and Configuration Guide 而且我认为JBoss确实支持Log4J,至少根据以下JBoss Admin Doc的第340页: 管理和配置指南

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

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