You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by tn...@bellsouth.net on 2003/04/21 23:47:11 UTC

common-logging and log4j - message issue

Hi,

Has anyone else encountered a problem with the ConversionPattern not converting correctly?

Here is my problem.  I have configured our application to use Log4j as per the documentation by adding the commons-logging.properties and log4j.properties files under the /WEB-INF/classes directory.  We are using the nightly build of Struts 1.1B from 4/8/2003 since it addressed some other issues we were encountering with the validator.

It seems to be utilizing log4j just fine, but when it displays the log messages based on my ConversionPattern:

    log4j.appender.rolling.layout.ConversionPattern=%d %-5p [%c] (%F:%L) - %m%n

It keeps placing (?:?) for the value of (%F:%L) which should be the Filename and line number.  The common-logging and log4j properties are listed below.  I can't seem to see the problem, but am clearly missing something.  Any help is appreciated.

Thanks in advance for the assistance.

Regards,

Todd G. Nist

<----- Configuration Files ------>

commons-logging.properties:
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JCategoryLog

log4j.properties:
log4j.appender.rolling=org.apache.log4j.RollingFileAppender

# Configure the name of the logout for the rolling appender
log4j.appender.rolling.File=c:/temp/logs/application.log

# Set up the maximum size of the rolling log files
log4j.appender.rolling.MaxFileSize=100KB

# Keep one backup file of the rolling appender
log4j.appender.rolling.MaxBackupIndex=1

# Configure the Layout pattern and conversion pattern for the rolling appender
log4j.appender.rolling.layout=org.apache.log4j.PatternLayout
#log4j.appender.rolling.layout.ConversionPattern=%d %-5p [%c] %l - %m%n
log4j.appender.rolling.layout.ConversionPattern=%d %-5p [%c] (%F:%L) - %m%n

# Print only messages of priority which is equal to or above the value specified
# below for a given package.

# Only show the INFO and above (suppress DEBUG) messages for org.apache
log4j.logger.org.apache=INFO
# Only show warnings (WARN) or above for commons
log4j.logger.org.apache.commons=WARN
# Only show WARN and above for Struts and Tiles
log4j.logger.org.apache.struts.tiles=WARN
log4j.logger.org.apache.struts=WARN
# Show all for our application
log4j.logger.com.tgn.callout=DEBUG



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


Re: common-logging and log4j - message issue

Posted by "K.C. Baltz" <kc...@lollimail.com>.
Are you compiling with debug symbols included?  Perhaps it needs that in 
order to give you that information. 

You  might try sending this to the Log4J mailing list.

K.C.

tnist@bellsouth.net wrote:

>Hi,
>
>Has anyone else encountered a problem with the ConversionPattern not converting correctly?
>
>Here is my problem.  I have configured our application to use Log4j as per the documentation by adding the commons-logging.properties and log4j.properties files under the /WEB-INF/classes directory.  We are using the nightly build of Struts 1.1B from 4/8/2003 since it addressed some other issues we were encountering with the validator.
>
>It seems to be utilizing log4j just fine, but when it displays the log messages based on my ConversionPattern:
>
>    log4j.appender.rolling.layout.ConversionPattern=%d %-5p [%c] (%F:%L) - %m%n
>
>It keeps placing (?:?) for the value of (%F:%L) which should be the Filename and line number.  The common-logging and log4j properties are listed below.  I can't seem to see the problem, but am clearly missing something.  Any help is appreciated.
>
>Thanks in advance for the assistance.
>
>Regards,
>
>Todd G. Nist
>
><----- Configuration Files ------>
>
>commons-logging.properties:
>org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JCategoryLog
>
>log4j.properties:
>log4j.appender.rolling=org.apache.log4j.RollingFileAppender
>
># Configure the name of the logout for the rolling appender
>log4j.appender.rolling.File=c:/temp/logs/application.log
>
># Set up the maximum size of the rolling log files
>log4j.appender.rolling.MaxFileSize=100KB
>
># Keep one backup file of the rolling appender
>log4j.appender.rolling.MaxBackupIndex=1
>
># Configure the Layout pattern and conversion pattern for the rolling appender
>log4j.appender.rolling.layout=org.apache.log4j.PatternLayout
>#log4j.appender.rolling.layout.ConversionPattern=%d %-5p [%c] %l - %m%n
>log4j.appender.rolling.layout.ConversionPattern=%d %-5p [%c] (%F:%L) - %m%n
>
># Print only messages of priority which is equal to or above the value specified
># below for a given package.
>
># Only show the INFO and above (suppress DEBUG) messages for org.apache
>log4j.logger.org.apache=INFO
># Only show warnings (WARN) or above for commons
>log4j.logger.org.apache.commons=WARN
># Only show WARN and above for Struts and Tiles
>log4j.logger.org.apache.struts.tiles=WARN
>log4j.logger.org.apache.struts=WARN
># Show all for our application
>log4j.logger.com.tgn.callout=DEBUG
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>  
>


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