Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Log4j creates an empty file

 
Cesar Rodrigue
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic