You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Quinton McCombs <qm...@nequalsone.com> on 2002/11/22 19:17:48 UTC

Question requarding Log4J as the logging mechanism

I am using version 3.0RC1 of Torque.  Consider the following from my
Torque.properties file.

log4j.category.org.apache.torque = ALL, org.apache.torque
log4j.appender.org.apache.torque = org.apache.log4j.FileAppender
log4j.appender.org.apache.torque.file = ${webappRoot}/logs/torque.log
log4j.appender.org.apache.torque.layout = org.apache.log4j.PatternLayout
log4j.appender.org.apache.torque.layout.conversionPattern = %d [%t] %-5p
%c - %m%n
log4j.appender.org.apache.torque.append = false
log4j.appender.org.apache.torque.level = DEBUG

The problem here is that I don't get a torque.log file.  I am getting
all of the torque messages written to turbine.log.  

Here is the applicable section from TurbineResource.properties:

services.LoggingService.facilities=system
services.LoggingService.default=system
services.LoggingService.loggingConfig=org.apache.turbine.services.logging.PropertiesLoggingConfig

# log 4 java configuration
services.LoggingService.system.log4j.rootCategory = DEBUG, system
services.LoggingService.system.log4j.category.system = DEBUG, system
services.LoggingService.system.log4j.appender.system.file =
${webappRoot}/logs/turbine.log
services.LoggingService.system.log4j.appender.system =
org.apache.log4j.FileAppender
services.LoggingService.system.log4j.appender.system.layout =
org.apache.log4j.PatternLayout
services.LoggingService.system.log4j.appender.system.layout.conversionPattern = %d [%t] %-5p %c - %m%n
services.LoggingService.system.log4j.appender.system.append = false

services.LoggingService.system.className=org.apache.turbine.services.logging.Log4JavaLogger
services.LoggingService.system.level=DEBUG


Besides the question of why I do not get a torque.log file, I have
another one.  Consider the following two lines from TR props.

services.LoggingService.system.log4j.rootCategory = DEBUG, system
services.LoggingService.system.level=DEBUG

What does DEBUG, system mean after rootCategory=???  There does not seem
to be a difference in operation if I change DEBUG to ALL.  Also how does
this differ from setting the level on the second line.

I see the same type of pattern from torque.properties.  I have exactly
the same question though.  I am thinking that the second parameter to to
the first statement is the category.  But if that is true, it seems
redundant.  Perhaps it is the name of the appender(s).  If so, I am
still confused about the meaning of ALL.

log4j.category.org.apache.torque = ALL, org.apache.torque
log4j.appender.org.apache.torque.level = DEBUG


I did read the Log4J docs.  That did not answer those questions.

Thanks in advance!