Hi Phil, > Armin, do you think this is sufficiently on-topic to be a short addition > to the deployment-jBoss section of the docs?
I will copy paste your description to the jboss-section. regards, Armin ----- Original Message ----- From: "Phil Warrick" <[EMAIL PROTECTED]> To: "OJB Users List" <[EMAIL PROTECTED]> Sent: Friday, June 27, 2003 6:03 AM Subject: Re: log4j with jBoss, bis > Hi, > > It's OK now. I wasn't keeping all my OJB.properties files well > synchronized. My LoggerClass setting was > > LoggerClass=org.apache.ojb.broker.util.logging.PoorMansLoggerImpl > > rather than > > LoggerClass=org.apache.ojb.broker.util.logging.Log4jLoggerImpl > > I have different OJB.properties file for standalone OJB development and > jboss development and they diverged. > > > In summary, to use log4j logging with OJB within jBoss, > > 1) set LoggerClass in OJB.properties as described above. There is no > need for a log4j.properties file of OJB-specific log4j settings (in fact > the OJB.properties setting LoggerConfigFile is ignored). Instead, the > jBoss log4j configuration file must be used: > 2) in JBOSS_HOME/server/default/conf/log4j.xml, add categories to define > appenders and add/filter logging for desired OJB packages following the > numerous examples in that file. For example, > > <category name="org.apache.ojb"> > <priority value="DEBUG" /> > <appender-ref ref="CONSOLE"/> > <appender-ref ref="FILE"/> > </category> > > > > <category name="org.apache.ojb.broker.metadata.RepositoryXmlHandler"> > <priority value="ERROR" /> > <appender-ref ref="CONSOLE"/> > <appender-ref ref="FILE"/> > </category> > > > Armin, do you think this is sufficiently on-topic to be a short addition > to the deployment-jBoss section of the docs? > > Phil > > Phil Warrick wrote: > > Hi all, > > > > I'm having trouble turning on OJB logging with log4j within jBoss. My > > jboss/server/default/conf/log4j.xml is below (Thanks Dave Derry). I'm > > able to control the level of org.jboss logging with this file, but the > > only OJB logging I see is level INFO. Can anyone see what's wrong? > > > > Thanks, > > > > Phil > > > > <?xml version="1.0" encoding="UTF-8"?> > > <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> > > > > <!-- > > ===================================================================== -- > > > <!-- --> > > <!-- Log4j Configuration --> > > <!-- --> > > <!-- > > ===================================================================== -- > > > > > <!-- $Id: log4j.xml,v 1.5.2.6 2002/09/27 22:29:24 patriot1burke Exp $ --> > > > > <!-- > > | For more configuration infromation and examples see the Jakarta Log4j > > | owebsite: http://jakarta.apache.org/log4j > > --> > > > > <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" > > debug="false"> > > > > <!-- ================================= --> > > <!-- Preserve messages in a local file --> > > <!-- ================================= --> > > > > <!-- A time/date based rolling appender --> > > <appender name="FILE" > > class="org.jboss.logging.appender.DailyRollingFileAppender"> > > <param name="File" value="${jboss.server.home.dir}/log/server.log"/> > > <param name="Append" value="false"/> > > <param name="Threshold" value="INFO"/> > > > > <!-- Rollover at midnight each day --> > > <param name="DatePattern" value="'.'yyyy-MM-dd"/> > > > > <!-- Rollover at the top of each hour > > <param name="DatePattern" value="'.'yyyy-MM-dd-HH"/> > > --> > > > > <layout class="org.apache.log4j.PatternLayout"> > > <!-- The default pattern: Date Priority [Category] Message\n --> > > <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/> > > > > <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) > > Message\n > > <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) > > %m%n"/> > > --> > > </layout> > > </appender> > > > > <!-- A size based file rolling appender > > <appender name="FILE" > > class="org.jboss.logging.appender.RollingFileAppender"> > > <param name="File" value="${jboss.server.home.dir}/log/server.log"/> > > <param name="Append" value="false"/> > > <param name="MaxFileSize" value="500KB"/> > > <param name="MaxBackupIndex" value="1"/> > > > > <layout class="org.apache.log4j.PatternLayout"> > > <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/> > > </layout> > > </appender> > > --> > > > > <!-- ============================== --> > > <!-- Append messages to the console --> > > <!-- ============================== --> > > > > <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"> > > <!--param name="Threshold" value="INFO"/--> > > <param name="Threshold" value="DEBUG"/> > > <param name="Target" value="System.out"/> > > > > <layout class="org.apache.log4j.PatternLayout"> > > <!-- The default pattern: Date Priority [Category] Message\n --> > > <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] > > %m%n"/> > > </layout> > > </appender> > > > > > > <!-- ====================== --> > > <!-- More Appender examples --> > > <!-- ====================== --> > > > > <!-- Buffer events and log them asynchronously > > <appender name="ASYNC" class="org.apache.log4j.AsyncAppender"> > > <appender-ref ref="FILE"/> > > <appender-ref ref="CONSOLE"/> > > <appender-ref ref="SMTP"/> > > </appender> > > --> > > > > <!-- EMail events to an administrator > > <appender name="SMTP" class="org.apache.log4j.net.SMTPAppender"> > > <param name="Threshold" value="ERROR"/> > > <param name="To" value="[EMAIL PROTECTED]"/> > > <param name="From" value="[EMAIL PROTECTED]"/> > > <param name="Subject" value="JBoss Sever Errors"/> > > <param name="SMTPHost" value="localhost"/> > > <param name="BufferSize" value="10"/> > > <layout class="org.apache.log4j.PatternLayout"> > > <param name="ConversionPattern" value="[%d{ABSOLUTE},%c{1}] %m%n"/> > > </layout> > > </appender> > > --> > > > > <!-- Syslog events > > <appender name="SYSLOG" class="org.apache.log4j.net.SyslogAppender"> > > <param name="Facility" value="LOCAL7"/> > > <param name="FacilityPrinting" value="true"/> > > <param name="SyslogHost" value="localhost"/> > > </appender> > > --> > > > > <!-- Log events to JMS (requires a topic to be created) > > <appender name="JMS" class="org.apache.log4j.net.JMSAppender"> > > <param name="Threshold" value="ERROR"/> > > <param name="TopicConnectionFactoryBindingName" > > value="java:/ConnectionFactory"/> > > <param name="TopicBindingName" value="topic/MyErrorsTopic"/> > > </appender> > > --> > > > > <!-- ================ --> > > <!-- Limit categories --> > > <!-- ================ --> > > > > <!-- Limit JBoss categories to INFO--> > > <category name="org.jboss"> > > <priority value="INFO"/> > > </category> > > <!-- --> > > > > <!-- Increase the priority threshold for the DefaultDS category > > <category name="DefaultDS"> > > <priority value="FATAL"/> > > </category> > > --> > > > > <!-- Decrease the priority threshold for the org.jboss.varia category > > <category name="org.jboss.varia"> > > <priority value="DEBUG"/> > > </category> > > --> > > > > <!-- > > | An example of enabling the custom TRACE level priority that is used > > | by the JBoss internals to diagnose low level details. This example > > | turns on TRACE level msgs for the org.jboss.ejb.plugins package > > and its > > | subpackages. This will produce A LOT of logging output. > > If you use replace the log4j 1.2 jar with a 1.1.3 jar you will > > need to > > change this from XLevel to XPriority. > > <category name="org.jboss.system"> > > <priority value="TRACE" class="org.jboss.logging.XLevel"/> > > </category> > > <category name="org.jboss.ejb.plugins"> > > <priority value="TRACE" class="org.jboss.logging.XLevel"/> > > </category> > > --> > > > > <category name="org.apache.ojb"> > > <priority value="DEBUG" /> > > <appender-ref ref="CONSOLE"/> > > <appender-ref ref="FILE"/> > > </category> > > > > > > <category name="org.apache.ojb.broker.metadata.RepositoryXmlHandler"> > > <priority value="ERROR" /> > > <appender-ref ref="CONSOLE"/> > > <appender-ref ref="FILE"/> > > </category> > > > > <!-- ======================= --> > > <!-- Setup the Root category --> > > <!-- ======================= --> > > > > <root> > > <appender-ref ref="CONSOLE"/> > > <appender-ref ref="FILE"/> > > </root> > > > > <!-- Clustering logging --> > > <!-- Uncomment the following to redirect the org.javagroups and > > org.jboss.ha categories to a cluster.log file. > > > > <appender name="CLUSTER" > > class="org.jboss.logging.appender.RollingFileAppender"> > > <param name="File" value="${jboss.server.home.dir}/log/cluster.log"/> > > <param name="Append" value="false"/> > > <param name="MaxFileSize" value="500KB"/> > > <param name="MaxBackupIndex" value="1"/> > > > > <layout class="org.apache.log4j.PatternLayout"> > > <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/> > > </layout> > > </appender> > > <category name="org.javagroups"> > > <priority value="DEBUG" /> > > <appender-ref ref="CLUSTER"/> > > </category> > > <category name="org.jboss.ha"> > > <priority value="DEBUG" /> > > <appender-ref ref="CLUSTER"/> > > </category> > > --> > > > > </log4j:configuration> > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
