[jboss-user] [Installation, Configuration & DEPLOYMENT] - Re: log multile FILEs appender on JBoss

gan.gary do-not-reply at jboss.com
Tue Jul 29 04:23:02 EDT 2008


thanks, PeterJ. I think it's something like this in POJO:

static final Logger logger = Logger.getLogger(AAA.class);
  | static final Logger loggerTxn = Logger.getLogger("txn." + AAA.class);

and something like this in "jboss-log4j.xml":
<appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
  |       <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
  |       <param name="File" value="${jboss.server.log.dir}/server.log"/>
  |       <param name="Append" value="false"/>
  |       <param name="DatePattern" value="'.'yyyy-MM-dd"/>
  |       <layout class="org.apache.log4j.PatternLayout"> 
  |          <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
  |  
  |       </layout>
  |    </appender> 
  |    
  |    <appender name="TXNFILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
  |       <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
  |       <param name="File" value="${jboss.server.log.dir}/JBossSavedFailed.csv"/>
  |       <param name="Append" value="false"/>		 <param name="Threshold" value="INFO"/>
  |       <param name="DatePattern" value="'.'yyyy-MM-dd"/>
  |       <layout class="org.apache.log4j.PatternLayout"> 
  |          <param name="ConversionPattern" value="%m%n"/>
  | 		<!--%d = date/timestamp
  | 		%p = process level
  | 		%c = class
  | 		%m = message
  | 		%n = new line-->
  |       </layout>
  |    </appender>
  | 
  | ...
  | 
  | <category name="txn">
  |       <priority value="INFO"/>
  | 	  <appender-ref ref="TXNFILE"/>
  |    </category>

in case newcomer need it and JBoss still not yet archive this post.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4167251#4167251

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4167251



More information about the jboss-user mailing list