Log4j stopped writing logs
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   sangeeta_bhatia
Posted On:   Tuesday, October 7, 2008 01:26 PM

Hi All, I am using log4j-1.2.8.jar in a simple web application which reads an excel file and populates some tables in the database. The problem I am facing is that all the logs are written only at the time of server start-up. Any subsequent transaction is not being logged at all. Would anyone have any clue about this? Contents of log4j.properties are below: #Logger Properties log4j.rootCategory=debug, rolling log4j.category.org.apache.wsif=debug log4j.category.com.bt=debug log4j.category.com.bt.fce=debug log4j.category.com.bt.fce.spiAdmin=debug log4j.category.com.bt.fce.spiAdmin.domain.dao=debug log4j.category.com.bt.fce.spiAdmin.web.ac   More>>

Hi All,


I am using log4j-1.2.8.jar in a simple web application which reads an excel file and populates some tables in the database.


The problem I am facing is that all the logs are written only at the time of server start-up. Any subsequent transaction is not being logged at all.
Would anyone have any clue about this? Contents of log4j.properties are below:



#Logger Properties

log4j.rootCategory=debug, rolling

log4j.category.org.apache.wsif=debug

log4j.category.com.bt=debug

log4j.category.com.bt.fce=debug

log4j.category.com.bt.fce.spiAdmin=debug

log4j.category.com.bt.fce.spiAdmin.domain.dao=debug

log4j.category.com.bt.fce.spiAdmin.web.action=debug

log4j.category.com.bt.fce.spiAdmin.web.form=debug



# ROLLING FILE APPENDER (rolling)

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



# configuration information

log4j.appender.rolling.File=fce_spiadmin_rolling.log

log4j.appender.rolling.MaxFileSize=1000KB



# Keep one backup file

log4j.appender.rolling.MaxBackupIndex=2

log4j.appender.rolling.layout=org.apache.log4j.PatternLayout

log4j.appender.rolling.layout.ConversionPattern=[%r] %d{dd MMM yyyy HH:mm:ss} %c : %M %-5p - %m%n



# ROLLING FILE APPENDER (auditlog)

log4j.appender.auditlog=org.apache.log4j.RollingFileAppender



# configuration information

log4j.appender.auditlog.File=Audit_logs.log

log4j.appender.auditlog.MaxFileSize=1000KB



# Keep one backup file

log4j.appender.auditlog.MaxBackupIndex=2

log4j.appender.auditlog.layout=org.apache.log4j.PatternLayout

log4j.appender.auditlog.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss} , %m%n


Thanks for your help and time!    <<Less

Re: Log4j stopped writing logs

Posted By:   sangeeta_bhatia  
Posted On:   Friday, October 24, 2008 12:25 PM

It took a lot of testing, but we have figured out what the issue is.
For some reason, my application is writing all logs to the root logger, ignoring the category specific loggers.

It is not even writing to both root logger as well as category specific, but only to the root logger.
So if root logger is null, application does not write logs.

I am stuck at this point now, as I cannot understand why this would be happening..
The log4j debug logs might be of help:



log4j: Trying to find [log4j.xml] using context classloader weblogic.utils.classloaders.ChangeAwareClassLoader@139626c( finder: weblogic.utils.classloaders.CodeGenClassFinder@1fc7299, annotation: BTAdminBulkload@BTAdminBulkload, parent: weblogic.utils.classloaders.GenericClassLoader@6ccf3e( finder: weblogic.utils.classloaders.CodeGenClassFinder@c7d960, annotation: BTAdminBulkload@, parent: weblogic.utils.classloaders.GenericClassLoader@e6c6d7( finder: weblogic.utils.classloaders.CodeGenClassFinder@904497, annotation: ApplicationClassLoader@, parent: weblogic.utils.classloaders.GenericClassLoader@cb2185( finder: weblogic.utils.classloaders.CodeGenClassFinder@187514a, annotation: null, parent: sun.misc.Launcher$AppClassLoader@53c015)))).

log4j: Trying to find [log4j.xml] using sun.misc.Launcher$AppClassLoader@53c015 class loader.

log4j: Trying to find [log4j.xml] using ClassLoader.getSystemResource().

log4j: Trying to find [log4j.properties] using context classloader weblogic.utils.classloaders.ChangeAwareClassLoader@139626c( finder: weblogic.utils.classloaders.CodeGenClassFinder@1fc7299, annotation: BTAdminBulkload@BTAdminBulkload, parent: weblogic.utils.classloaders.GenericClassLoader@6ccf3e( finder: weblogic.utils.classloaders.CodeGenClassFinder@c7d960, annotation: BTAdminBulkload@, parent: weblogic.utils.classloaders.GenericClassLoader@e6c6d7( finder: weblogic.utils.classloaders.CodeGenClassFinder@904497, annotation: ApplicationClassLoader@, parent: weblogic.utils.classloaders.GenericClassLoader@cb2185( finder: weblogic.utils.classloaders.CodeGenClassFinder@187514a, annotation: null, parent: sun.misc.Launcher$AppClassLoader@53c015)))).

log4j: Using URL [file:/wls_domains/gsp2/deploy/BTAdminBulkload/WEB-INF/classes/log4j.properties] for automatic log4j configuration.

log4j: Reading configuration from URL file:/wls_domains/gsp2/deploy/BTAdminBulkload/WEB-INF/classes/log4j.properties

log4j: Parsing for [root] with value=[DEBUG,testAppender].

log4j: Level token is [DEBUG].

log4j: Category root set to DEBUG

log4j: Parsing appender named "testAppender".

log4j: Parsing layout options for "testAppender".

log4j: Setting property [conversionPattern] to [<%d{dd MMM yyyy HH:mm:ss.SSS}>[%t] [%-5p] [%c] - %m%n].

log4j: End of parsing for "testAppender".

log4j:WARN No such property [.MaxBackupIndex] in org.apache.log4j.RollingFileAppender.

log4j: Setting property [immediateFlush] to [true].

log4j: Setting property [maxFileSize] to [10000KB].

log4j: Setting property [file] to [/logs/gsp2/rootlogger.log].

log4j: setFile called: /logs/gsp2/rootlogger.log, true

log4j: setFile ended

log4j: Parsed "testAppender" options.

log4j: Parsing for [org.springframework] with value=[WARN, jpeAppender].

log4j: Level token is [WARN].

log4j: Category org.springframework set to WARN

log4j: Parsing appender named "jpeAppender".

log4j: Parsing layout options for "jpeAppender".

log4j: Setting property [conversionPattern] to [<%d{dd MMM yyyy HH:mm:ss.SSS}>[%t] [%-5p] [%c] - %m%n].

log4j: End of parsing for "jpeAppender".

log4j: Setting property [immediateFlush] to [true].

log4j: Setting property [maxBackupIndex] to [5].

log4j: Setting property [file] to [/logs/gsp2/btadminbulkload.log].

log4j: Setting property [maxFileSize] to [10000KB].

log4j: setFile called: /logs/gsp2/btadminbulkload.log, true

log4j: setFile ended

log4j: Parsed "jpeAppender" options.

log4j: Handling log4j.additivity.org.springframework=[null]

log4j: Parsing for [org.omg] with value=[WARN, jpeAppender].

log4j: Level token is [WARN].

log4j: Category org.omg set to WARN

log4j: Parsing appender named "jpeAppender".

log4j: Appender "jpeAppender" was already parsed.

log4j: Handling log4j.additivity.org.omg=[null]

log4j: Parsing for [org.displaytag] with value=[WARN, jpeAppender].

log4j: Level token is [WARN].

log4j: Category org.displaytag set to WARN

log4j: Parsing appender named "jpeAppender".

log4j: Appender "jpeAppender" was already parsed.

log4j: Handling log4j.additivity.org.displaytag=[null]

log4j: Parsing for [org.apache] with value=[WARN, jpeAppender].

log4j: Level token is [WARN].

log4j: Category org.apache set to WARN

log4j: Parsing appender named "jpeAppender".

log4j: Appender "jpeAppender" was already parsed.

log4j: Handling log4j.additivity.org.apache=[null]

log4j: Parsing for [org.objectweb] with value=[WARN, jpeAppender].

log4j: Level token is [WARN].

log4j: Category org.objectweb set to WARN

log4j: Parsing appender named "jpeAppender".

log4j: Appender "jpeAppender" was already parsed.

log4j: Handling log4j.additivity.org.objectweb=[null]

log4j: Parsing for [org.enhydra] with value=[WARN, jpeAppender].

log4j: Level token is [WARN].

log4j: Category org.enhydra set to WARN

log4j: Parsing appender named "jpeAppender".

log4j: Appender "jpeAppender" was already parsed.

log4j: Handling log4j.additivity.org.enhydra=[null]

log4j: Parsing for [com.bt.gsportal.admin] with value=[DEBUG, jpeAppender].

log4j: Level token is [DEBUG].

log4j: Category com.bt.gsportal.admin set to DEBUG

log4j: Parsing appender named "jpeAppender".

log4j: Appender "jpeAppender" was already parsed.

log4j: Handling log4j.additivity.com.bt.gsportal.admin=[null]

log4j: Finished configuring.

log4j: Could not find root logger information. Is this OK?

log4j: Parsing for [org.apache.axis] with value=[WARN].

log4j: Level token is [WARN].

log4j: Category org.apache.axis set to WARN

log4j: Handling log4j.additivity.org.apache.axis=[null]

log4j: Parsing for [org.apache.commons.digester] with value=[WARN].

log4j: Level token is [WARN].

log4j: Category org.apache.commons.digester set to WARN

log4j: Handling log4j.additivity.org.apache.commons.digester=[null]

log4j: Parsing for [org.apache.struts] with value=[WARN].

log4j: Level token is [WARN].

log4j: Category org.apache.struts set to WARN

log4j: Handling log4j.additivity.org.apache.struts=[null]

log4j: Parsing for [org.displaytag] with value=[WARN].

log4j: Level token is [WARN].

log4j: Category org.displaytag set to WARN

log4j: Handling log4j.additivity.org.displaytag=[null]

log4j: Parsing for [org.apache.commons.beanutils] with value=[WARN].

log4j: Level token is [WARN].

log4j: Category org.apache.commons.beanutils set to WARN

log4j: Handling log4j.additivity.org.apache.commons.beanutils=[null]

log4j: Finished configuring.


All logs are being written to rootlogger.log.

Any thoughts anyone?

Regards,
Sangeeta

About | Sitemap | Contact