Re: using a different log4j.properties file per classes directory
You have to deploy log4j.jar in both common/lib as well as WEB-INF/lib of each app. Tomcat will use the one in common/lib and each webapp will use the one in its respective WEB-INF/lib (because of child-first, or parent-last, classloading behavior of webapps). Jake On 7/11/2009 6:01 PM, Lucas Vickers wrote: Hello, Excuse my simple question as I am new to tomcat/log4j. I have looked at the mailing list and did some googling but no luck. What I would like to do is have my tomcat installation use one log file, and then my own servlet use a different log file. ./common/classes/log4j.properties = log4j.rootLogger=INFO, R log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.appender.R.File=${catalina.home}/logs/tomcat.log log4j.appender.R.MaxFileSize=100MB log4j.appender.R.MaxBackupIndex=50 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n ./webapps/servlets-examples/WEB-INF/classes/log4j.properties = log4j.rootLogger=DEBUG, R log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.appender.R.File=${catalina.home}/logs/tabs.log log4j.appender.R.MaxFileSize=10MB log4j.appender.R.MaxBackupIndex=100 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n Ideal result is that my class in /servlets-examples will be in DEBUG level and will output to the tabs.log It appears that my servlet-examples is outputting to tomcat.og and is in INFO level. Could anyone please help me figure out what I am missing. Many thanks, Lucas - To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org
Re: using a different log4j.properties file per classes directory
log4j under Tomcat is known to be fishy regarding class path. Are you sure this suggestion works? On Mon, Jul 13, 2009 at 10:27 AM, Jacob Kjome h...@visi.com wrote: You have to deploy log4j.jar in both common/lib as well as WEB-INF/lib of each app. Tomcat will use the one in common/lib and each webapp will use the one in its respective WEB-INF/lib (because of child-first, or parent-last, classloading behavior of webapps). Jake On 7/11/2009 6:01 PM, Lucas Vickers wrote: Hello, Excuse my simple question as I am new to tomcat/log4j. I have looked at the mailing list and did some googling but no luck. What I would like to do is have my tomcat installation use one log file, and then my own servlet use a different log file. ./common/classes/log4j.properties = log4j.rootLogger=INFO, R log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.appender.R.File=${catalina.home}/logs/tomcat.log log4j.appender.R.MaxFileSize=100MB log4j.appender.R.MaxBackupIndex=50 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n ./webapps/servlets-examples/WEB-INF/classes/log4j.properties = log4j.rootLogger=DEBUG, R log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.appender.R.File=${catalina.home}/logs/tabs.log log4j.appender.R.MaxFileSize=10MB log4j.appender.R.MaxBackupIndex=100 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n Ideal result is that my class in /servlets-examples will be in DEBUG level and will output to the tabs.log It appears that my servlet-examples is outputting to tomcat.og and is in INFO level. Could anyone please help me figure out what I am missing. Many thanks, Lucas - To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org
Re: using a different log4j.properties file per classes directory
Work for me. Different versions require different setups. 5.5 required log4j.jar and commons-logging.jar in common/lib. 6.x requries you to manually rebuild their custom logging framework to work with Log4j. By default, it's hard-wired to JUL. So, all that can be considered fishy. I've never really had an issue with the per-app logging when placing log4j.jar in WEB-INF/lib even with another copy in common/lib. What issues have you run into? Jake On 7/13/2009 12:30 AM, Yair Ogen wrote: log4j under Tomcat is known to be fishy regarding class path. Are you sure this suggestion works? On Mon, Jul 13, 2009 at 10:27 AM, Jacob Kjome h...@visi.com wrote: You have to deploy log4j.jar in both common/lib as well as WEB-INF/lib of each app. Tomcat will use the one in common/lib and each webapp will use the one in its respective WEB-INF/lib (because of child-first, or parent-last, classloading behavior of webapps). Jake On 7/11/2009 6:01 PM, Lucas Vickers wrote: Hello, Excuse my simple question as I am new to tomcat/log4j. I have looked at the mailing list and did some googling but no luck. What I would like to do is have my tomcat installation use one log file, and then my own servlet use a different log file. ./common/classes/log4j.properties = log4j.rootLogger=INFO, R log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.appender.R.File=${catalina.home}/logs/tomcat.log log4j.appender.R.MaxFileSize=100MB log4j.appender.R.MaxBackupIndex=50 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n ./webapps/servlets-examples/WEB-INF/classes/log4j.properties = log4j.rootLogger=DEBUG, R log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.appender.R.File=${catalina.home}/logs/tabs.log log4j.appender.R.MaxFileSize=10MB log4j.appender.R.MaxBackupIndex=100 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n Ideal result is that my class in /servlets-examples will be in DEBUG level and will output to the tabs.log It appears that my servlet-examples is outputting to tomcat.og and is in INFO level. Could anyone please help me figure out what I am missing. Many thanks, Lucas - To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org - To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org
AW: DailyRollingFileAppender RollingFileAppender after a rollover continues to write on previous file...
Problems with the rolling over behaviour occur mostly if more than one Appender write to the same file, e.g. out from different JVM's (since the file system cannot rename it if the other Appender still holds a handle on the file). Heri -Ursprüngliche Nachricht- Von: Roberto Simoni [mailto:roberto.sim...@yahoo.it] Gesendet: Freitag, 10. Juli 2009 11:38 An: log4j-user@logging.apache.org Betreff: [SPAM (Bayesain Analysis)] - DailyRollingFileAppender RollingFileAppender after a rollover continues to write on previous file... - Bayesian Filter detected spam Hi to all. We use log4j in a big project for our customer on a linux/unix system (JBoss 4, JDK 1.5). Every day, I see current time logs present in two log file... the current (application_name.log) and the previous log (application_name.log.date_pattern or application_name.log.counter) as the rollover operation hasn't stopped to write to the previous file. We have only a log4j.xml file and a file appender configured. What I see is that when the problem occurs a lot of logs is in writing in that moment. We have a batch operation at midnight, so with DailyRollingFileAppender the problem occurs everyday, instead with RollingFileAppender the problem occurs only if the rollover is made around midnight. I have seen that rollover operation is *not* synchronized due to a already synchronization on doAppend method (as sad in RollingFileAppender class). Are you confident on this behaviour? Thanks in advance Bye - To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org
Re: AW: DailyRollingFileAppender RollingFileAppender after a rollover continues to write on previous file...
Thanks Heri. I have read more in deep log4j sources and found that rollOver method is used in the synched method doAppend, so forget my question. Yeah, I think we have a problem in our JBoss configuration... I'm trying to tame the beast Thanks to all Bye Bender Heri ha scritto: Problems with the rolling over behaviour occur mostly if more than one Appender write to the same file, e.g. out from different JVM's (since the file system cannot rename it if the other Appender still holds a handle on the file). Heri -Ursprüngliche Nachricht- Von: Roberto Simoni [mailto:roberto.sim...@yahoo.it] Gesendet: Freitag, 10. Juli 2009 11:38 An: log4j-user@logging.apache.org Betreff: [SPAM (Bayesain Analysis)] - DailyRollingFileAppender RollingFileAppender after a rollover continues to write on previous file... - Bayesian Filter detected spam Hi to all. We use log4j in a big project for our customer on a linux/unix system (JBoss 4, JDK 1.5). Every day, I see current time logs present in two log file... the current (application_name.log) and the previous log (application_name.log.date_pattern or application_name.log.counter) as the rollover operation hasn't stopped to write to the previous file. We have only a log4j.xml file and a file appender configured. What I see is that when the problem occurs a lot of logs is in writing in that moment. We have a batch operation at midnight, so with DailyRollingFileAppender the problem occurs everyday, instead with RollingFileAppender the problem occurs only if the rollover is made around midnight. I have seen that rollover operation is *not* synchronized due to a already synchronization on doAppend method (as sad in RollingFileAppender class). Are you confident on this behaviour? Thanks in advance Bye - To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org - To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org
Telegram based DailyRollingFile appender?
Hi there, the DailyRollingFile appender is great for my needs. But there's one point: I'm logging remote on a centralized repository. If I'm logging and my LAN connection is truncated, even only for a period of some seconds, it is not going to start logging after the connection is ok again. It's ok for me, that those messages, produced in the period the LAN connection was gone are lost, but that the DailyRollingFile appender doesn't continue to log after the connection is ready again does hit me hard. :( I'm additionally using the nagios appender and this one for example works. I'm loosing the log messages for the time the connection isn't established but as soon as the connection comes back im getting my informations in nagios. Is there any way for a file appender, such as the DailyRollingFile appender, to make it more resistant to connection loss? Thanks in advance for your answers. Greetings, Collatz -- View this message in context: http://www.nabble.com/Telegram-based-DailyRollingFile-appender--tp24462850p24462850.html Sent from the Log4j - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org