Topic
  • 1 reply
  • Latest Post - ‏2010-12-29T09:33:01Z by SystemAdmin
cesar.rodriguez
cesar.rodriguez
1 Post

Pinned topic Log4j creates an empty log file

‏2010-11-29T11:36:06Z |
Hi,

traying to use log4j in my application with the same log4j.properties and using a servlet for the initialization in WebSphere 6.1.0.9 it works fine, but in WebSphere 6.1.0.21 it doesn't write log in stdout an it creates de log file but with 0 Kbytes ever.

LOG4J.PROPERTIES:
log4j.rootCategory=INFO, stdout, LOGFILE

log4j.category.es.myApp=DEBUG
log4j.category.org.w3c.tidy=FATAL

  1. SqlMap logging configuration...
log4j.logger.java.sql.Connection=INFO
log4j.logger.java.sql.Statement=INFO
log4j.logger.java.sql.PreparedStatement=INFO
log4j.logger.java.sql.ResultSet=INFO
  1. Console output...
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p %t - %m%n

#file output
  1. log4j.appender.LOGFILE=org.apache.log4j.DailyRollingFileAppender
log4j.appender.LOGFILE=org.apache.log4j.RollingFileAppender
log4j.appender.LOGFILE.file=/logs/myApp.log
log4j.appender.LOGFILE.append=true
log4j.appender.LOGFILE.DatePattern='.'yyyy-MM-dd

log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.LOGFILE.layout.ConversionPattern=%5p %t - %m%n
Updated on 2010-12-29T09:33:01Z at 2010-12-29T09:33:01Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    4447 Posts

    Re: Log4j creates an empty log file

    ‏2010-12-29T09:33:01Z  
    Hi,

    log4j.category.es.myApp=DEBUG
    log4j.category.org.w3c.tidy=FATAL

    this should be something like :

    log4j.category.es.myApp=DEBUG, stdout, LOGFILE
    log4j.category.org.w3c.tidy=FATAL, stdout, LOGFILE

    HTH