logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scheik, Timothy" <timothy.sch...@frontiercorp.com>
Subject JDBC Appender - No output - No Errors
Date Thu, 12 Jan 2006 20:17:57 GMT
   I am trying to log to a MySQL database.  I have successfully set up the File and Console
Appenders.  However, I can not get the JDBC Appender to work.  If the JDBC Appender is used
the logging for the console and files basically stops.  Messages never get to the DB.  The
insert statement works fine from a local JBDC class.  I have included my log4j.xml config
file.  Any help would be appreciated.

BTW, I am using log4j 1.2.13
		MySQL 5.0 (locally)
		& JBoss 3.2.2 

Thanks,
Tim

******************************************************************************

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="true">


  <!-- ================================= -->
  <!-- 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"/>

    <!-- 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>

  <!-- ==================================== -->
  <!-- Append messages to the JDBC 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/log4jDemo" />
	<param name="User" value="log4j" />
	<param name="Password" value="log4j" />
	<layout class="org.apache.log4j.PatternLayout">	
		<param name="ConversionPattern" value=
				"INSERT INTO LOGGING_SAMPLES_TEST (log_date, log_level, location, message) VALUES ( '%d','%p',
'%C;%L', '%m' )"/>
		
	</layout>
   </appender>

  <!-- ============================== -->
  <!-- Append messages to the console -->
  <!-- ============================== -->

  <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
    <param name="Target" value="System.out"/>
    <param name="Threshold" value="DEBUG"/>

    <layout class="org.apache.log4j.PatternLayout">
      <!-- The default pattern: Date Priority [Category] Message\n -->
      <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c] %m%n"/>
    </layout>
  </appender>

  <appender name="CAP_LOG" class="org.jboss.logging.appender.RollingFileAppender"> 
   <param name="File" value="${jboss.server.home.dir}/log/cap.log"/>
    <param name="Append" value="false"/>
    <param name="MaxFileSize" value="500KB"/>
    <param name="MaxBackupIndex" value="1"/>
    <param name="Threshold" value="DEBUG"/>

    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
    </layout>
  </appender> 
  	

   <root>
    <appender-ref ref="CONSOLE"/>
    <appender-ref ref="FILE"/>  
    <appender-ref ref="JDBC"/>  
  </root>

</log4j:configuration>


******************************************************************************


15:09:43,597 INFO  [Log4jService$URLWatchTimerTask] Configuring from URL: resource:log4j.xml
log4j: Threshold ="null".
log4j: Retreiving an instance of org.apache.log4j.Logger.
log4j: Setting [cap] additivity to [true].
log4j: Level value for cap is  [INFO].
log4j: cap level set to INFO
log4j: Retreiving an instance of org.apache.log4j.Logger.
log4j: Setting [cap.stats] additivity to [true].
log4j: Level value for cap.stats is  [DEBUG].
log4j: cap.stats level set to DEBUG
log4j: Retreiving an instance of org.apache.log4j.Logger.
log4j: Setting [cap.scms] additivity to [true].
log4j: Level value for cap.scms is  [DEBUG].
log4j: cap.scms level set to DEBUG
log4j: Retreiving an instance of org.apache.log4j.Logger.
log4j: Setting [cap.stats] additivity to [true].
log4j: Level value for cap.stats is  [DEBUG].
log4j: cap.stats level set to DEBUG
log4j: Class name: [org.jboss.logging.appender.RollingFileAppender]
log4j: Setting property [file] to [C:\Applics\capsrv-3.2.2\jboss-3.2.2\server\cap/log/cap.log].
log4j: Setting property [append] to [false].
log4j: Setting property [maxFileSize] to [500KB].
log4j: Setting property [maxBackupIndex] to [1].
log4j: Setting property [threshold] to [DEBUG].
log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
log4j: Setting property [conversionPattern] to [%d %-5p [%c] %m%n].
log4j: setFile called: C:\Applics\capsrv-3.2.2\jboss-3.2.2\server\cap/log/cap.log, false
log4j: setFile ended
log4j: Adding appender named [CAP_LOG] to category [cap.stats].
log4j: Retreiving an instance of org.apache.log4j.Logger.
log4j: Setting [cap.scms] additivity to [true].
log4j: Level value for cap.scms is  [DEBUG].
log4j: cap.scms level set to DEBUG
log4j: Adding appender named [CAP_LOG] to category [cap.scms].
log4j: Retreiving an instance of org.apache.log4j.Logger.
log4j: Setting [org.jboss] additivity to [true].
log4j: Level value for org.jboss is  [INFO].
log4j: org.jboss level set to INFO
log4j: Retreiving an instance of org.apache.log4j.Logger.
log4j: Setting [org.apache.commons] additivity to [true].
log4j: Level value for org.apache.commons is  [ERROR].
log4j: org.apache.commons level set to ERROR
log4j: Retreiving an instance of org.apache.log4j.Logger.
log4j: Setting [org.apache.Log4j] additivity to [true].
log4j: Level value for org.apache.Log4j is  [DEBUG].
log4j: org.apache.Log4j level set to DEBUG
log4j: Retreiving an instance of org.apache.log4j.Logger.
log4j: Setting [org.apache.struts] additivity to [true].
log4j: Level value for org.apache.struts is  [ERROR].
log4j: org.apache.struts level set to ERROR
log4j: Retreiving an instance of org.apache.log4j.Logger.
log4j: Setting [org.apache.axis] additivity to [true].
log4j: Level value for org.apache.axis is  [ERROR].
log4j: org.apache.axis level set to ERROR
log4j: Retreiving an instance of org.apache.log4j.Logger.
log4j: Setting [org.javagroups] additivity to [true].
log4j: Level value for org.javagroups is  [ERROR].
log4j: org.javagroups level set to ERROR
log4j: Retreiving an instance of org.apache.log4j.Logger.
log4j: Setting [org.jboss.ha] additivity to [true].
log4j: Level value for org.jboss.ha is  [ERROR].
log4j: org.jboss.ha level set to ERROR
log4j: Retreiving an instance of org.apache.log4j.Logger.
log4j: Setting [DefaultPartition:ReplicantManager] additivity to [true].
log4j: Level value for DefaultPartition:ReplicantManager is  [ERROR].
log4j: DefaultPartition:ReplicantManager level set to ERROR
log4j: Retreiving an instance of org.apache.log4j.Logger.
log4j: Setting [org.jboss.mq] additivity to [true].
log4j: Level value for org.jboss.mq is  [INFO].
log4j: Desired Level sub-class: [org.jboss.logging.XLevel]
log4j: org.jboss.mq level set to INFO
log4j: Class name: [org.apache.log4j.ConsoleAppender]
log4j: Setting property [target] to [System.out].
log4j: Setting property [threshold] to [DEBUG].
log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
log4j: Setting property [conversionPattern] to [%d{ABSOLUTE} %-5p [%c] %m%n].
log4j: Adding appender named [CONSOLE] to category [root].
log4j: Class name: [org.jboss.logging.appender.DailyRollingFileAppender]
log4j: Setting property [file] to [C:\Applics\capsrv-3.2.2\jboss-3.2.2\server\cap/log/server.log].
log4j: Setting property [append] to [false].
log4j: Setting property [datePattern] to ['.'yyyy-MM-dd].
log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
log4j: Setting property [conversionPattern] to [%d %-5p [%c] %m%n].
log4j: setFile called: C:\Applics\capsrv-3.2.2\jboss-3.2.2\server\cap/log/server.log, false
log4j: setFile ended
log4j: Appender [FILE] to be rolled at midnight.
log4j: Adding appender named [FILE] to category [root].
log4j: Class name: [org.apache.log4j.jdbc.JDBCAppender]
log4j: Setting property [driver] to [com.mysql.jdbc.Driver].
log4j: Setting property [URL] to [jdbc:mysql://localhost:3306/log4jDemo].
log4j: Setting property [user] to [log4j].
log4j: Setting property [password] to [log4j].
log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
log4j: Setting property [conversionPattern] to [INSERT INTO LOGGING_SAMPLES_TEST (log_date,
log_level, location, message) VALUES ( '%d','%p', '%C;%L', '%m' )].
log4j: Adding appender named [JDBC] to category [root].

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message