Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Other Open Source Projects and the fly likes log4j configuration headaches on AIX Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Reply Bookmark "log4j configuration headaches on AIX" Watch "log4j configuration headaches on AIX" New topic
Author

log4j configuration headaches on AIX

balan subramanian
Greenhorn

Joined: Sep 23, 2003
Posts: 1
Hi All,
I have been struggling with this problem for a long time now and would definitely appreciate your help. I am trying to configure log4j using a properties file. This file is in the lib folder within my primary folder. I run the java program from the primary folder with a -Dlog4j.configuration=lib/log4j.properties. Here is that file,
# Set root category priority to INFO and its only appender to CONSOLE.
# log4j.rootCategory=DEBUG, LOGFILE
# log4j.rootCategory=ERROR, CONSOLE, LOGFILE
# log4j.rootCategory=INFO, LOGFILE
# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Threshold=ERROR
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=- %m%n
# LOGFILE is set to be a File appender using a PatternLayout.
log4j.appender.LOGFILE=org.apache.log4j.FileAppender
log4j.appender.LOGFILE.File=balan_acadapter.log
log4j.appender.LOGFILE.Append=true
log4j.appender.LOGFILE.Threshold=DEBUG
log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.LOGFILE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
Now if I change the file name it works fine, it writes to the new file etc. But if I change the rootcategory to have it write only to a file it doesn't seem to take that. I can't seem to change the level either.
All this is on AIX. Please help!
Balan
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: log4j configuration headaches on AIX
 
Similar Threads
Logging with axis 1.4 and log4j.
how to consume a webservice using axis2
Need help with log4j logging tool to log into database
Websphere 6.1 - Apache commons logging with log4j does not work
log4j:WARN No appenders could be found for logger (log4jexample.LogExample).