[jboss-user] [Installation, Configuration & Deployment] - Boot logging question

rachmatowicz@jboss.com do-not-reply at jboss.com
Fri Mar 16 12:17:21 EDT 2007


Hi

I'm trying to get a trace of org.jboss.Shutdown and org.jboss.server.system.Server. I've found that JBoss's use of log4j is split between boot logging (where you configure log4j via a log4j.properties file in run.jar), server logging (where you configure log4j via server//conf/jboss-log4j.xml and application logging (where you configure log4j via log4j.properties in WEB-INF/classes). 

I have extraced logj4-trace.properties from run.jar and modified it to add an appender called SHUTDOWN and two categories to pickup the trace messages i'm interested in:

log4j.rootCategory=TRACE#org.jboss.logging.XLevel, FILE, CONSOLE
log4j.category.org.jboss.Shutdown=TRACE#org.jboss.logging.XLevel, SHUTDOWN
log4j.category.org.jboss.system.server.Server=TRACE#org.jboss.logging.XLevel, SHUTDOWN

### A bootstrap file appender
log4j.appender.FILE=org.jboss.logging.appender.FileAppender
log4j.appender.FILE.File=${jboss.server.log.dir}/boot.log
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c{1}] %m%n
log4j.appender.FILE.Append=false

log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Target=System.out
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c{1}] %m%n

log4j.appender.SHUTDOWN=org.jboss.logging.appender.FileAppender
log4j.appender.SHUTDOWN.File=${jboss.server.log.dir}/shutdown.log
log4j.appender.SHUTDOWN.layout=org.apache.log4j.PatternLayout
log4j.appender.SHUTDOWN.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c{1}] %m%n
log4j.appender.SHUTDOWN.Append=false

I start the server with 
./run.sh -Dlog4j.configuration=log4j-trace.properties -c default 
and the trace statements appear on the console and boot log, but there is no log file shutdown.log created. 

I'm also getting occasional error messages like:
log4j:WARN No appenders could be found for logger (org.jboss.mx.loading.RepositoryClassLoader).
log4j:WARN Please initialize the log4j system properly.

My question: 
1. is there anything obviously wrong with this log4j-trace.properties file which I am missing and which explains why the shutdown.log file is not getting created
2. what is the best way to trap log.trace() messages on org.jboss.Shutdown and org.jboss.system.server.Server. 

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

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



More information about the jboss-user mailing list