Jboss 5.1中的特定于应用程序的日志记录 [英] Application Specific Logging in Jboss 5.1

查看:111
本文介绍了Jboss 5.1中的特定于应用程序的日志记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在jboss AS的CONFIG目录中添加了以下配置

I added following configuration in my jboss AS'S CONFIG directory

jboss-log4j.xml文件中的条目

Entry in jboss-log4j.xml file

<appender name="YYY" class="org.apache.log4j.FileAppender">
      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"></errorHandler>
      <param name="Append" value="false"/>
      <param name="File" value="${jboss.server.home.dir}/log/app1.log"/>
      <layout class="org.apache.log4j.PatternLayout">
         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
      </layout>
   </appender>
  <category name="com.XXX">
  <priority value="INFO" />
     <appender-ref ref="YYY"></appender-ref>
   </category>

我已经看到在JBoss启动时创建了app1.log.在我的应用程序war文件中没有特定于应用程序的log4j.properties或log4j.xml文件.我想要的只是来自com.XXX的类应该登录到app1 .log.但没有发生.

I have seen app1.log been created on JBoss start up.I do not have an app specific log4j.properties or log4j.xml file inside my application war file.All I wanted is classes from com.XXX should log to app1.log.But its not happening.

在我的应用程序大战中,我没有使用log4j.properties就可以实现它.我的Jboss的配置方式是应使用jboss-log4j.xml文件覆盖特定于应用程序的log4j.properties.

Cant I achieve it with out having a log4j.properties in my application war. My Jboss is configured in such a way that application specific log4j.properties should be override with jboss-log4j.xml file.

任何帮助表示赞赏

推荐答案

除了您提到的配置之外,您还需要确保您的应用程序war不包含任何log4j.jar或commons-logging.jar文件.

In addition to the configuration you mentioned, you need to make sure your application war does not include any log4j.jar or commons-logging.jar files.

这篇关于Jboss 5.1中的特定于应用程序的日志记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆