On Feb 14, 2005, at 7:02 AM, Michael Grissom wrote:
...I have the following set up and have a few questions:
************** start *****************************************
log4j.rootCategory=INFO, A1 log4j.rootLogger= DEBUG, CLIPROLLINGLOG
################################################## # Rolling log for CLIP (CLIPROLLINGLOG) log4j.appender.CLIPROLLINGLOG=org.apache.log4j.RollingFileAppender
### CLIP ### log4j.logger.gov.twcc.txcomp.clip=DEBUG, CLIPROLLINGLOG log4j.additivity.gov.twcc.txcomp.clip=false
...
1) Is there a better way to do this? Note that I have one log (I have many more logs, but the rest will be based on the responses I get from this email) and it seems like there might be a "shorter" way to put this. In this case, I am using all at debug level, but that probably won't stay that way (at least not for a permanent basis).
The file does seem unnecessary complex for what it does. First, rootCategory and rootLogger are synonymous. Category was changed to to Logger to bring the names into synch with the JDK 1.4 logging. In this case, I think the last one wins, so you could remove the rootCategory line.
The whole section after ### CLIP ### appears to be unnecessary. The rootLogger establishes that all loggers will have a level of DEBUG and be appended to CLIPROLLINGLOG unless overridden. The lines after CLIP establish exceptions for particular nodes in the hierarchy, but the exceptions have exactly the same settings as the root settings and accomplish nothing.
2) If I add a new log, will I have to basically repeat this whole block except with a new name (something instead of CLIPROLLOINGLOG)?
You only need to mention a logger in the configuration when its settings are different than its immediate ancestor.
3) If there are multiple logs, can I just append them to the "log4j.rootLogger= DEBUG, CLIPROLLINGLOG" line (like log4j.rootLogger= DEBUG, CLIPROLLINGLOG, NEWLOG, ANOTHERNEWLOG)?
Yes, you can add multiple appenders.
4) Is the rootCategory just having a "default" impact, meaning that if I don't specify otherwise, I get INFO? And does this ONLY apply to A1? If so, could I append the new log names onto this as in question number 3?
I don't think it having any impact since it is being overriden by the folling rootLogger statement.
5) Is there a way to include everything from a point on in a directory structure (gov.twcc.txcomp.clip*) rather than having to say each one independently?
Yes, if you specify anything for a level in the hierarchy, it applies to all descendant nodes unless overridden. If everything has the same properties, just set it at root.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
