seam is logging under the category of STDOUT instead of com.mycategory
mmckeen1 Feb 20, 2009 9:27 AMI am having a bit of trouble configuring logging for my seam application. I am using seam 2.1 and jboss 4.2. Below is the config file I am using to configure log4j for the jboss server and everything is working well except in my seam code I specify a category (see below) of com.mycategory
for the logger however when seam outputs the log entry it uses the category of STDOUT
. It appears that seam is not using log4j as its logger and is just defaulting to System.out (assuming that STDOUT means System.out) jboss then intercepts the output and uses log4j with the category of STDOUT. Is there something I missed in a configuration file to get seam to use log4j provided by the jboss server?
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="true"> <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="JDBC" class="org.apache.log4j.jdbc.JDBCAppender"> <param name="driver" value="com.mysql.jdbc.Driver"/> <param name="URL" value="jdbc:mysql://localhost:3306/VIRTUAL_TRIAL" /> <param name="User" value="root" /> <param name="Password" value="" /> <param name="BufferSize" value="1" /> <param name="Threshold" value="INFO"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value= "INSERT INTO Log (log_date,log_level, location, message) VALUES ('%d{yyyy-MM-dd HH:mm:ss.SSS}','%p', '%c', '%m' )"/> </layout> </appender> <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"> <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/> <param name="Target" value="System.out"/> <param name="Threshold" value="INFO"/> <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> <!-- ================ --> <!-- Limit categories --> <!-- ================ --> <category name="com.mycategory"> <-- WORKS if I change this to STDOUT <priority value="INFO" /> <appender-ref ref="JDBC"/> </category> <root> <appender-ref ref="CONSOLE"/> <appender-ref ref="FILE"/> </root> </log4j:configuration>
JAVA CODE:
public class AdminHomeBean implements AdminHome { @Logger ("com.mycategory") private Log log; public void initConfigurations() { log.info("Test"); if (configurations == null) ...more code... } }
LOG FILE
00:31:56,412 INFO [STDOUT] - Test
When I change the category to STDOUT the entries show up in the Database, however when I change it to com.mycategory
nothing is added to the database log