log4j appender question
807597Sep 1 2005 — edited Jul 15 2008I need some log4j help. Hope anyone can help me.
Question 1:
I need to log information to 4 different files. As far as I can tell from the log4j docs, I will then need to create 4 different appenders in the log4j.properties file. How can I do that?
Looking at examples, it looks like I will need to add 4 new sections similar to this one. Is that correct?
# Logfile 1
log4j.appender.log1=org.apache.log4j.RollingFileAppender
log4j.appender.log1.File=C:/Sun/logs/logme1.log
Question 2:
After that is done, how can I actually write to the files? When logging I was thinking just using: logger.info("log something").
How can I specify which file that will log to? Is that even the correct way to log?
Hope someone can help!