Log4j stops logging at rollover...
We have 6 machines serving a web services application. The application is deployed on tomcat 6.0.24. We are using log4j for logging. We have log4j configured to roll over at midnight. Every night when the logs are rolled 1-3 of the instances stops logging. There is always one exception in the new log and nothing else. The instance continues to run normally. We know that from the tomcat logs. The following exception is in the log. It is always this same exception. It looks to me like your basic lost connection on upload problem. My theory is that the upload started before midnight and that the thread wrote to the log, and some how this write caused the process to keep the log open. When the rolling appender tried to roll the log it could not because the file is open. Sometime after midnight the upload looses connection and that exception is written to the opened log. That doesn't make complete sense though, because I would think to see all of yesterdays log messages in the log. Any ideas what is going on here? Suggestions for next steps in trying to debug this? I've also included the log4j configuration file. Thanks for any help. Michael- --- [2010-10-22 06:04:43,126] ERROR - org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/ddp].[spring] - Servlet.service() for servlet spring threw exception java.net.SocketTimeoutException: Read timed out at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:129) at org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:751) at org.apache.coyote.http11.InternalInputBuffer$InputStreamInputBuffer.doRead(InternalInputBuffer.java:781) at org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:116) at org.apache.coyote.http11.InternalInputBuffer.doRead(InternalInputBuffer.java:710) at org.apache.coyote.Request.doRead(Request.java:428) at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:304) at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:405) at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:327) at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:193) at org.apache.commons.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStream.java:977) at org.apache.commons.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:887) at java.io.InputStream.read(InputStream.java:85) at org.apache.commons.fileupload.util.Streams.copy(Streams.java:94) at org.apache.commons.fileupload.util.Streams.copy(Streams.java:64) at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:362) at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126) at org.springframework.web.multipart.commons.CommonsMultipartResolver.parseRequest(CommonsMultipartResolver.java:155) at org.springframework.web.multipart.commons.CommonsMultipartResolver.resolveMultipart(CommonsMultipartResolver.java:138) at org.springframework.web.servlet.DispatcherServlet.checkMultipart(DispatcherServlet.java:907) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:750) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.adobe.ddp.http.MultipartContentTypeFilter.doFilter(MultipartContentTypeFilter.java:22) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at
Re: Log4j stops logging
On Oct 13, 2008, at 10:03 AM, Sangeeta Bhatia wrote: All, I am using Log4j-Version 1.2.8, java version 1.4.2_13. The application simply stops writing logs after sometime. I saw a similar thread on the forum: http://www.nabble.com/Log4j-Version---1.2.8-occasionally-stops-logging-without-any-error-message-to19580787.html#a19655737 Sorry if i am asking the same question again but this thrread wasn't concluded. Is this is known bug/issue and is upgrade the only option available? In the earlier thread, the user had not provided a configuration file, so all that we knew is that some appender in a very old version of log4j stopped working on some unspecified operating system under some unspecified condition. log4j.properties reads as follows: log4j.appender.jpeAppender.file=/logs/gsp2/btadminbulkload.log #-Non Configurable Variables -- log4j.rootCategory=DEBUG,jpeAppender log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d{dd MMM HH:mm:ss.SSS}[%t] [%-5p] - %m%n log4j.appender.jpeAppender=org.apache.log4j.RollingFileAppender Does the problem still occur if you use just a plain FileAppender? All the RollingFileAppenders have more failure options than FileAppenders. The org.apache.log4j.rolling.RollingFileAppender in the extras companion should be more robust than the org.apache.log4j.RollingFileAppender, but even it still has more ways to go wrong. log4j.appender.jpeAppender.ImmediateFlush=true # number of log files to keep before deleting the oldest one log4j.appender.jpeAppender.MaxBackupIndex=5 log4j.appender.jpeAppender.MaxFileSize=1KB # Log message layout: date-time [thread] priority category - message lineTerminator log4j.appender.jpeAppender.layout=org.apache.log4j.PatternLayout log4j.appender.jpeAppender.layout.ConversionPattern=%d{dd MMM HH:mm:ss.SSS}[%t] [%-5p] [%c] - %m%n #log4j.rootLogger=ERROR # Package level log specifications # Log levels used by Log4j in ascending order are: # debug, info, warn, error, and fatal log4j.logger.org.apache=WARN, jpeAppender log4j.logger.org.objectweb=WARN, jpeAppender log4j.logger.org.enhydra=WARN, jpeAppender log4j.logger.org.omg=WARN, jpeAppender log4j.logger.org.springframework=WARN, jpeAppender log4j.logger.org.displaytag=WARN, jpeAppender log4j.logger.com.bt=DEBUG, jpeAppender The ,jpeAppender in previous lines is unnecessary and should result in duplication of messages in the log files. # Enables or Disables logging operations log.debug.enabled=true log.info.enabled=true log.warn.enabled=true log.error.enabled=true log.fatal.enabled=true log.timing.enabled=true # Enables or Disables logging of stack trace log.stacktrace.enabled=false # Enables or Disables logging of stack trace in case of exception log.exception.stacktrace.enabled=true # Logger class #log.logger.class=org.apache.log4j.Logger I don't believe that any of these lines would be recognized by log4j. I assume that you can reproduce the problem. It would be helpful if you could perform some or all of following experiments: a) switch from org.apache.log4j.RollingFileAppender to FileAppender. If you no longer see the problem, then it is likely an issue with org.apache.log4j.RollingFileAppender. b) Add log4j.debug=true to the configuration file and see if there are any diagnostic messages to the console around the time of failure. c) Upgrade to log4j 1.2.15 and see if the issue goes away. d) Switch from org.apache.log4j.RollingFileAppender to org.apache.log4j.rolling.RollingFIleAppender. The extras companion should work with log4j 1.2.8, but you will likely need to use an XML configuration file. e) If you can create a simple app that demonstrates the problem, create a Bugzilla entry and upload the app and tell how to trigger the failure. Please specify JVM version, operating system, and log4j versions tested. Please test at least log4j 1.2.8 and 1.2.15. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Log4j stops logging
All, I am using Log4j-Version 1.2.8, java version 1.4.2_13. The application simply stops writing logs after sometime. I saw a similar thread on the forum: http://www.nabble.com/Log4j-Version---1.2.8-occasionally-stops-logging-without-any-error-message-to19580787.html#a19655737 Sorry if i am asking the same question again but this thrread wasn't concluded. Is this is known bug/issue and is upgrade the only option available? log4j.properties reads as follows: log4j.appender.jpeAppender.file=/logs/gsp2/btadminbulkload.log #-Non Configurable Variables -- log4j.rootCategory=DEBUG,jpeAppender log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d{dd MMM HH:mm:ss.SSS}[%t] [%-5p] - %m%n log4j.appender.jpeAppender=org.apache.log4j.RollingFileAppender log4j.appender.jpeAppender.ImmediateFlush=true # number of log files to keep before deleting the oldest one log4j.appender.jpeAppender.MaxBackupIndex=5 log4j.appender.jpeAppender.MaxFileSize=1KB # Log message layout: date-time [thread] priority category - message lineTerminator log4j.appender.jpeAppender.layout=org.apache.log4j.PatternLayout log4j.appender.jpeAppender.layout.ConversionPattern=%d{dd MMM HH:mm:ss.SSS}[%t] [%-5p] [%c] - %m%n #log4j.rootLogger=ERROR # Package level log specifications # Log levels used by Log4j in ascending order are: # debug, info, warn, error, and fatal log4j.logger.org.apache=WARN, jpeAppender log4j.logger.org.objectweb=WARN, jpeAppender log4j.logger.org.enhydra=WARN, jpeAppender log4j.logger.org.omg=WARN, jpeAppender log4j.logger.org.springframework=WARN, jpeAppender log4j.logger.org.displaytag=WARN, jpeAppender log4j.logger.com.bt=DEBUG, jpeAppender # Enables or Disables logging operations log.debug.enabled=true log.info.enabled=true log.warn.enabled=true log.error.enabled=true log.fatal.enabled=true log.timing.enabled=true # Enables or Disables logging of stack trace log.stacktrace.enabled=false # Enables or Disables logging of stack trace in case of exception log.exception.stacktrace.enabled=true # Logger class #log.logger.class=org.apache.log4j.Logger Thanks for your time and help! Regards, Sangeeta -- View this message in context: http://www.nabble.com/Log4j-stops-logging-tp19956418p19956418.html Sent from the Log4j - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: log4j stops logging at console
This problem was fixed in (I believe) jBoss 4.0.2. Of course in that same versions they screwed up other stuff... (i.e.: Hibernate would no longer work if you had it in your application) so you may or may not want to use that version anyway. But they are aware of the issues and I hope they will eventually fix all these problems. Good luck. Bruno Melloni Director of Software Architecture Akuratus Corporation 1333 N. Stemmons Fwy, Suite 110 Dallas, Texas 75207 Phone: 469.227.0920 Fax: 469.227.0967 [EMAIL PROTECTED] www.akuratus.com [EMAIL PROTECTED] 5/16/2005 11:38:55 AM JBoss, by current design, only provides for one logging context (ie LoggerRepository). On top of that, the JBoss log4j.xml also sets up a special CONSOLE appender that maps the System.out and System.err streams. If you do any kind of configuration after JBoss starts up that affects the console appender OR affects loggers that have been defined in the JBoss log4j.xml file, then it will affect the output to the log files. Especially Console, do not mess with Console. Also, if your log4j code ever calls LoggerRepository.shutdown() during a redeploy, then logging will be hosed as well. JBoss really needs to provide a better mechanism to allowing web apps and ejb's to do their own logging. Log4j does provide some layering of configuration where you can set up your own loggers and appenders as long as they are not references by the first/base configuration file. Or you can just add your logging stuff to the JBoss log4j.xml file directly. You may also find the following link useful, but I don't know if anyone has gotten to work correctly in JBoss or not. Seems to me that to be completely efficient, it would need to be supported pretty deep in the JBoss log4j initialization. http://www.qos.ch/logging/sc.jsp -Mark -Original Message- From: Clandes Tino [mailto:[EMAIL PROTECTED] Sent: Monday, May 16, 2005 6:51 AM To: log4j-user@logging.apache.org Subject: log4j stops logging at console Hello all. I am facing the problem with log4j usage in two separate applications. I am using CONSOLE appenders for both of them. Applications are started separately (in two shell windows). The first app (App1) is assembled as EAR and deployed under JBoss (it uses log4j.jar from JBoss/server/default/lib and initializes log4j through MBean, where appenders and loggers are configured). Here is the method in MBean that configures log4j in App1: --- private void initLog4j() throws ConfigurationException { final Properties props = new Properties(); props.setProperty(log4j.category.com.myapp, DEBUG, CONSOLE, FILE); props.setProperty(log4j.appender.CONSOLE,org.apache.log4j.ConsoleAppend er); props.setProperty(log4j.appender.CONSOLE.layout,org.apache.log4j.Patter nLayout) props.setProperty(log4j.appender.CONSOLE.layout.ConversionPattern,%d{IS O8601} %-5p [%c{1}] [%X{user}] - %m%n); props.setProperty(log4j.appender.FILE,org.apache.log4j.RollingFileAppen der); props.setProperty(log4j.appender.FILE.File, getConfigurationSetting(LOG_FILE)); props.setProperty(log4j.appender.FILE.MaxFileSize, getConfigurationSetting(MAX_FILE_SIZE)); props.setProperty(log4j.appender.FILE.MaxBackupIndex, getConfigurationSetting(MAX_BACKUP_FILE)); props.setProperty(log4j.appender.FILE.layout,org.apache.log4j.PatternLa yout); props.setProperty(log4j.appender.FILE.layout.ConversionPattern,%d{ISO86 01} %-5p [%c{1}] [%X{user} %X{ip} %X{userAgent}] - %m%n); PropertyConfigurator.configure(props); } App1 uses A.jar and B.jar from App2 in compilation and runtime. Both jars are placed in sar archive and deployed in default/deploy folder under Jboss. The other (App2) is RMI Server application deployed separately (it uses another log4j-1.2.8.jar placed in its classpath). A.jar and B.jar are in its classpath. App2 configures log4j by log4j properties file: log4j.category.CONSOLE = , aCONSOLE log4j.appender.aCONSOLE = org.apache.log4j.ConsoleAppender log4j.additivity.CONSOLE=false log4j.appender.aCONSOLE.ImmediateFlush=true log4j.appender.aCONSOLE.layout=org.apache.log4j.PatternLayout -- Both applications are physically on the same machine. The problem occurs when some class from App1 invokes a class from B.jar. Then logging disappears from console window of App1. No further message in log appears. However logging into file works OK. My question is: What can cause such behavior? Thanx for the hint in advance. Best regards Milan ___ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com - To unsubscribe, e-mail
Re: log4j stops logging at console
Hello people, here is the scenario, which causes console logging to stop. Remote application (RMI server App), which is made by third party is started by batch file. Configuration file for log4j is found during startup and loggers are created, by using custom log4j.loggerFactory I entered some debug statements and saw that loggers are loaded with classLoader [EMAIL PROTECTED] Maybe it is important to tell you that there is used bad practice to have almighty class with many static properties, among which are the loggers. The second side of story is my client ear application under JBoss. Classes in my application depend on classes from RMI Server App, they need to have them in classpath in compile time. But in the runtime, classes from RMI server are not deployed anywhere else. Jboss is started with expanded JBOSS_CLASSPATH variable, changed in run.bat, containing paths to those classes. During startup, my MBean loaded by JBoss classloader [EMAIL PROTECTED] tries to connect to RMI Server and to obtain some remote class. But then above mentioned class on RMI Server side (containing constants and loggers as static members) is loaded again, this time with [EMAIL PROTECTED] Configuration file for log4j is parsed again and after PropertyConfigurator.configureAndWatch(s, 6L), I lose logging on Jboss CONSOLE, but logging to file remains. I hope, I gave you enough information. Any help, suggestion or hint would be more than welcome. Best regards Milan ___ Yahoo! Messenger - want a free and easy way to contact your friends online? http://uk.messenger.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: log4j stops logging at console
JBoss, by current design, only provides for one logging context (ie LoggerRepository). On top of that, the JBoss log4j.xml also sets up a special CONSOLE appender that maps the System.out and System.err streams. If you do any kind of configuration after JBoss starts up that affects the console appender OR affects loggers that have been defined in the JBoss log4j.xml file, then it will affect the output to the log files. Especially Console, do not mess with Console. Also, if your log4j code ever calls LoggerRepository.shutdown() during a redeploy, then logging will be hosed as well. JBoss really needs to provide a better mechanism to allowing web apps and ejb's to do their own logging. Log4j does provide some layering of configuration where you can set up your own loggers and appenders as long as they are not references by the first/base configuration file. Or you can just add your logging stuff to the JBoss log4j.xml file directly. You may also find the following link useful, but I don't know if anyone has gotten to work correctly in JBoss or not. Seems to me that to be completely efficient, it would need to be supported pretty deep in the JBoss log4j initialization. http://www.qos.ch/logging/sc.jsp -Mark -Original Message- From: Clandes Tino [mailto:[EMAIL PROTECTED] Sent: Monday, May 16, 2005 6:51 AM To: log4j-user@logging.apache.org Subject: log4j stops logging at console Hello all. I am facing the problem with log4j usage in two separate applications. I am using CONSOLE appenders for both of them. Applications are started separately (in two shell windows). The first app (App1) is assembled as EAR and deployed under JBoss (it uses log4j.jar from JBoss/server/default/lib and initializes log4j through MBean, where appenders and loggers are configured). Here is the method in MBean that configures log4j in App1: --- private void initLog4j() throws ConfigurationException { final Properties props = new Properties(); props.setProperty(log4j.category.com.myapp, DEBUG, CONSOLE, FILE); props.setProperty(log4j.appender.CONSOLE,org.apache.log4j.ConsoleAppend er); props.setProperty(log4j.appender.CONSOLE.layout,org.apache.log4j.Patter nLayout) props.setProperty(log4j.appender.CONSOLE.layout.ConversionPattern,%d{IS O8601} %-5p [%c{1}] [%X{user}] - %m%n); props.setProperty(log4j.appender.FILE,org.apache.log4j.RollingFileAppen der); props.setProperty(log4j.appender.FILE.File, getConfigurationSetting(LOG_FILE)); props.setProperty(log4j.appender.FILE.MaxFileSize, getConfigurationSetting(MAX_FILE_SIZE)); props.setProperty(log4j.appender.FILE.MaxBackupIndex, getConfigurationSetting(MAX_BACKUP_FILE)); props.setProperty(log4j.appender.FILE.layout,org.apache.log4j.PatternLa yout); props.setProperty(log4j.appender.FILE.layout.ConversionPattern,%d{ISO86 01} %-5p [%c{1}] [%X{user} %X{ip} %X{userAgent}] - %m%n); PropertyConfigurator.configure(props); } App1 uses A.jar and B.jar from App2 in compilation and runtime. Both jars are placed in sar archive and deployed in default/deploy folder under Jboss. The other (App2) is RMI Server application deployed separately (it uses another log4j-1.2.8.jar placed in its classpath). A.jar and B.jar are in its classpath. App2 configures log4j by log4j properties file: log4j.category.CONSOLE = , aCONSOLE log4j.appender.aCONSOLE = org.apache.log4j.ConsoleAppender log4j.additivity.CONSOLE=false log4j.appender.aCONSOLE.ImmediateFlush=true log4j.appender.aCONSOLE.layout=org.apache.log4j.PatternLayout -- Both applications are physically on the same machine. The problem occurs when some class from App1 invokes a class from B.jar. Then logging disappears from console window of App1. No further message in log appears. However logging into file works OK. My question is: What can cause such behavior? Thanx for the hint in advance. Best regards Milan ___ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: log4j stops logging at console
The thing that confused me was that it seemed like he was saying that there were two physically separate instances of JBoss being started up. That is, each in their own JVM. If that were the case, then this issue would be a bit perplexing. If it is all, ultimately running under a single JBoss instance, then your explanation makes sense. I wouldn't say that JBoss needs internal rework to get application-separated logging working, though. If the repository selector hasn't already been set, it can be set once by any application. If it has, then JBoss already has the concept in mind, and they must provide some sort of hook-in to be able to configure the repository selector. Jake At 09:38 AM 5/16/2005 -0700, you wrote: JBoss, by current design, only provides for one logging context (ie LoggerRepository). On top of that, the JBoss log4j.xml also sets up a special CONSOLE appender that maps the System.out and System.err streams. If you do any kind of configuration after JBoss starts up that affects the console appender OR affects loggers that have been defined in the JBoss log4j.xml file, then it will affect the output to the log files. Especially Console, do not mess with Console. Also, if your log4j code ever calls LoggerRepository.shutdown() during a redeploy, then logging will be hosed as well. JBoss really needs to provide a better mechanism to allowing web apps and ejb's to do their own logging. Log4j does provide some layering of configuration where you can set up your own loggers and appenders as long as they are not references by the first/base configuration file. Or you can just add your logging stuff to the JBoss log4j.xml file directly. You may also find the following link useful, but I don't know if anyone has gotten to work correctly in JBoss or not. Seems to me that to be completely efficient, it would need to be supported pretty deep in the JBoss log4j initialization. http://www.qos.ch/logging/sc.jsp -Mark -Original Message- From: Clandes Tino [mailto:[EMAIL PROTECTED] Sent: Monday, May 16, 2005 6:51 AM To: log4j-user@logging.apache.org Subject: log4j stops logging at console Hello all. I am facing the problem with log4j usage in two separate applications. I am using CONSOLE appenders for both of them. Applications are started separately (in two shell windows). The first app (App1) is assembled as EAR and deployed under JBoss (it uses log4j.jar from JBoss/server/default/lib and initializes log4j through MBean, where appenders and loggers are configured). Here is the method in MBean that configures log4j in App1: --- private void initLog4j() throws ConfigurationException { final Properties props = new Properties(); props.setProperty(log4j.category.com.myapp, DEBUG, CONSOLE, FILE); props.setProperty(log4j.appender.CONSOLE,org.apache.log4j.ConsoleAppend er); props.setProperty(log4j.appender.CONSOLE.layout,org.apache.log4j.Patter nLayout) props.setProperty(log4j.appender.CONSOLE.layout.ConversionPattern,%d{IS O8601} %-5p [%c{1}] [%X{user}] - %m%n); props.setProperty(log4j.appender.FILE,org.apache.log4j.RollingFileAppen der); props.setProperty(log4j.appender.FILE.File, getConfigurationSetting(LOG_FILE)); props.setProperty(log4j.appender.FILE.MaxFileSize, getConfigurationSetting(MAX_FILE_SIZE)); props.setProperty(log4j.appender.FILE.MaxBackupIndex, getConfigurationSetting(MAX_BACKUP_FILE)); props.setProperty(log4j.appender.FILE.layout,org.apache.log4j.PatternLa yout); props.setProperty(log4j.appender.FILE.layout.ConversionPattern,%d{ISO86 01} %-5p [%c{1}] [%X{user} %X{ip} %X{userAgent}] - %m%n); PropertyConfigurator.configure(props); } App1 uses A.jar and B.jar from App2 in compilation and runtime. Both jars are placed in sar archive and deployed in default/deploy folder under Jboss. The other (App2) is RMI Server application deployed separately (it uses another log4j-1.2.8.jar placed in its classpath). A.jar and B.jar are in its classpath. App2 configures log4j by log4j properties file: log4j.category.CONSOLE = , aCONSOLE log4j.appender.aCONSOLE = org.apache.log4j.ConsoleAppender log4j.additivity.CONSOLE=false log4j.appender.aCONSOLE.ImmediateFlush=true log4j.appender.aCONSOLE.layout=org.apache.log4j.PatternLayout -- Both applications are physically on the same machine. The problem occurs when some class from App1 invokes a class from B.jar. Then logging disappears from console window of App1. No further message in log appears. However logging into file works OK. My question is: What can cause such behavior? Thanx for the hint in advance. Best regards Milan ___ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo
RE: log4j stops logging at console
Quoting Mark Womack [EMAIL PROTECTED]: Yeah, but you are playing roulette with determining which application installs the respository selector and assuming they are all trying to install the same one. It really should be better supported at the container level. Have you gotten the JNDI context selector to work in JBoss? I tried some time ago and had problems, but did not have a chance to follow up in detail. Support at the container level would be nice. My point is that even if JBoss doesn't feel like supporting it, it is pretty easy to make it happen yourself without JBoss' support. If one controls the server to a certain degree, the whole roulette analogy fades away. Sometimes it is hard to get a project that big to listen to you in a timely manner. In any case, the only support we'd need at the container level would be setting a system property. Assuming the ContextJNDISelector works under JBoss, it would be very simple for someone to add the extra -D param to JBoss' startup script. I don't know why it wouldn't work? It works under Tomcat and weblogic. Should work in JBoss. Jake -Mark -Original Message- From: Jacob Kjome [mailto:[EMAIL PROTECTED] Sent: Monday, May 16, 2005 8:32 PM To: Log4J Users List Subject: RE: log4j stops logging at console The thing that confused me was that it seemed like he was saying that there were two physically separate instances of JBoss being started up. That is, each in their own JVM. If that were the case, then this issue would be a bit perplexing. If it is all, ultimately running under a single JBoss instance, then your explanation makes sense. I wouldn't say that JBoss needs internal rework to get application-separated logging working, though. If the repository selector hasn't already been set, it can be set once by any application. If it has, then JBoss already has the concept in mind, and they must provide some sort of hook-in to be able to configure the repository selector. Jake At 09:38 AM 5/16/2005 -0700, you wrote: JBoss, by current design, only provides for one logging context (ie LoggerRepository). On top of that, the JBoss log4j.xml also sets up a special CONSOLE appender that maps the System.out and System.err streams. If you do any kind of configuration after JBoss starts up that affects the console appender OR affects loggers that have been defined in the JBoss log4j.xml file, then it will affect the output to the log files. Especially Console, do not mess with Console. Also, if your log4j code ever calls LoggerRepository.shutdown() during a redeploy, then logging will be hosed as well. JBoss really needs to provide a better mechanism to allowing web apps and ejb's to do their own logging. Log4j does provide some layering of configuration where you can set up your own loggers and appenders as long as they are not references by the first/base configuration file. Or you can just add your logging stuff to the JBoss log4j.xml file directly. You may also find the following link useful, but I don't know if anyone has gotten to work correctly in JBoss or not. Seems to me that to be completely efficient, it would need to be supported pretty deep in the JBoss log4j initialization. http://www.qos.ch/logging/sc.jsp -Mark -Original Message- From: Clandes Tino [mailto:[EMAIL PROTECTED] Sent: Monday, May 16, 2005 6:51 AM To: log4j-user@logging.apache.org Subject: log4j stops logging at console Hello all. I am facing the problem with log4j usage in two separate applications. I am using CONSOLE appenders for both of them. Applications are started separately (in two shell windows). The first app (App1) is assembled as EAR and deployed under JBoss (it uses log4j.jar from JBoss/server/default/lib and initializes log4j through MBean, where appenders and loggers are configured). Here is the method in MBean that configures log4j in App1: --- private void initLog4j() throws ConfigurationException { final Properties props = new Properties(); props.setProperty(log4j.category.com.myapp, DEBUG, CONSOLE, FILE); props.setProperty(log4j.appender.CONSOLE,org.apache.log4j.ConsoleAppend er); props.setProperty(log4j.appender.CONSOLE.layout,org.apache.log4j.Patter nLayout) props.setProperty(log4j.appender.CONSOLE.layout.ConversionPattern,%d{IS O8601} %-5p [%c{1}] [%X{user}] - %m%n); props.setProperty(log4j.appender.FILE,org.apache.log4j.RollingFileAppen der); props.setProperty(log4j.appender.FILE.File, getConfigurationSetting(LOG_FILE)); props.setProperty(log4j.appender.FILE.MaxFileSize, getConfigurationSetting(MAX_FILE_SIZE
log4j stops logging at console
Hello all. I am facing the problem with log4j usage in two separate applications. I am using CONSOLE appenders for both of them. Applications are started separately (in two shell windows). The first app (App1) is assembled as EAR and deployed under JBoss (it uses log4j.jar from JBoss/server/default/lib and initializes log4j through MBean, where appenders and loggers are configured). Here is the method in MBean that configures log4j in App1: --- private void initLog4j() throws ConfigurationException { final Properties props = new Properties(); props.setProperty(log4j.category.com.myapp, DEBUG, CONSOLE, FILE); props.setProperty(log4j.appender.CONSOLE,org.apache.log4j.ConsoleAppender); props.setProperty(log4j.appender.CONSOLE.layout,org.apache.log4j.PatternLayout) props.setProperty(log4j.appender.CONSOLE.layout.ConversionPattern,%d{ISO8601} %-5p [%c{1}] [%X{user}] - %m%n); props.setProperty(log4j.appender.FILE,org.apache.log4j.RollingFileAppender); props.setProperty(log4j.appender.FILE.File, getConfigurationSetting(LOG_FILE)); props.setProperty(log4j.appender.FILE.MaxFileSize, getConfigurationSetting(MAX_FILE_SIZE)); props.setProperty(log4j.appender.FILE.MaxBackupIndex, getConfigurationSetting(MAX_BACKUP_FILE)); props.setProperty(log4j.appender.FILE.layout,org.apache.log4j.PatternLayout); props.setProperty(log4j.appender.FILE.layout.ConversionPattern,%d{ISO8601} %-5p [%c{1}] [%X{user} %X{ip} %X{userAgent}] - %m%n); PropertyConfigurator.configure(props); } App1 uses A.jar and B.jar from App2 in compilation and runtime. Both jars are placed in sar archive and deployed in default/deploy folder under Jboss. The other (App2) is RMI Server application deployed separately (it uses another log4j-1.2.8.jar placed in its classpath). A.jar and B.jar are in its classpath. App2 configures log4j by log4j properties file: log4j.category.CONSOLE = , aCONSOLE log4j.appender.aCONSOLE = org.apache.log4j.ConsoleAppender log4j.additivity.CONSOLE=false log4j.appender.aCONSOLE.ImmediateFlush=true log4j.appender.aCONSOLE.layout=org.apache.log4j.PatternLayout -- Both applications are physically on the same machine. The problem occurs when some class from App1 invokes a class from B.jar. Then logging disappears from console window of App1. No further message in log appears. However logging into file works OK. My question is: What can cause such behavior? Thanx for the hint in advance. Best regards Milan ___ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: log4j stops logging at console
On May 16, 2005, at 8:50 AM, Clandes Tino wrote: Hello all. I am facing the problem with log4j usage in two separate applications. I am using CONSOLE appenders for both of them. Applications are started separately (in two shell windows). The first app (App1) is assembled as EAR and deployed under JBoss (it uses log4j.jar from JBoss/server/default/lib and initializes log4j through MBean, where appenders and loggers are configured). Could you see if the problem occurs with the CVS HEAD? It might be an instance of bug 31056 (http://issues.apache.org/bugzilla/ show_bug.cgi?id=31056) which was recently addressed. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: log4j stops logging at console
JBoss, by current design, only provides for one logging context (ie LoggerRepository). On top of that, the JBoss log4j.xml also sets up a special CONSOLE appender that maps the System.out and System.err streams. If you do any kind of configuration after JBoss starts up that affects the console appender OR affects loggers that have been defined in the JBoss log4j.xml file, then it will affect the output to the log files. Especially Console, do not mess with Console. Also, if your log4j code ever calls LoggerRepository.shutdown() during a redeploy, then logging will be hosed as well. JBoss really needs to provide a better mechanism to allowing web apps and ejb's to do their own logging. Log4j does provide some layering of configuration where you can set up your own loggers and appenders as long as they are not references by the first/base configuration file. Or you can just add your logging stuff to the JBoss log4j.xml file directly. You may also find the following link useful, but I don't know if anyone has gotten to work correctly in JBoss or not. Seems to me that to be completely efficient, it would need to be supported pretty deep in the JBoss log4j initialization. http://www.qos.ch/logging/sc.jsp -Mark -Original Message- From: Clandes Tino [mailto:[EMAIL PROTECTED] Sent: Monday, May 16, 2005 6:51 AM To: log4j-user@logging.apache.org Subject: log4j stops logging at console Hello all. I am facing the problem with log4j usage in two separate applications. I am using CONSOLE appenders for both of them. Applications are started separately (in two shell windows). The first app (App1) is assembled as EAR and deployed under JBoss (it uses log4j.jar from JBoss/server/default/lib and initializes log4j through MBean, where appenders and loggers are configured). Here is the method in MBean that configures log4j in App1: --- private void initLog4j() throws ConfigurationException { final Properties props = new Properties(); props.setProperty(log4j.category.com.myapp, DEBUG, CONSOLE, FILE); props.setProperty(log4j.appender.CONSOLE,org.apache.log4j.ConsoleAppend er); props.setProperty(log4j.appender.CONSOLE.layout,org.apache.log4j.Patter nLayout) props.setProperty(log4j.appender.CONSOLE.layout.ConversionPattern,%d{IS O8601} %-5p [%c{1}] [%X{user}] - %m%n); props.setProperty(log4j.appender.FILE,org.apache.log4j.RollingFileAppen der); props.setProperty(log4j.appender.FILE.File, getConfigurationSetting(LOG_FILE)); props.setProperty(log4j.appender.FILE.MaxFileSize, getConfigurationSetting(MAX_FILE_SIZE)); props.setProperty(log4j.appender.FILE.MaxBackupIndex, getConfigurationSetting(MAX_BACKUP_FILE)); props.setProperty(log4j.appender.FILE.layout,org.apache.log4j.PatternLa yout); props.setProperty(log4j.appender.FILE.layout.ConversionPattern,%d{ISO86 01} %-5p [%c{1}] [%X{user} %X{ip} %X{userAgent}] - %m%n); PropertyConfigurator.configure(props); } App1 uses A.jar and B.jar from App2 in compilation and runtime. Both jars are placed in sar archive and deployed in default/deploy folder under Jboss. The other (App2) is RMI Server application deployed separately (it uses another log4j-1.2.8.jar placed in its classpath). A.jar and B.jar are in its classpath. App2 configures log4j by log4j properties file: log4j.category.CONSOLE = , aCONSOLE log4j.appender.aCONSOLE = org.apache.log4j.ConsoleAppender log4j.additivity.CONSOLE=false log4j.appender.aCONSOLE.ImmediateFlush=true log4j.appender.aCONSOLE.layout=org.apache.log4j.PatternLayout -- Both applications are physically on the same machine. The problem occurs when some class from App1 invokes a class from B.jar. Then logging disappears from console window of App1. No further message in log appears. However logging into file works OK. My question is: What can cause such behavior? Thanx for the hint in advance. Best regards Milan ___ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SV: Log4J stops logging
I think we found the problem. We have bunch of threads running and sometimes we don't want to log things like passwords etc. so we set the loglevel to WARN when these calls to the database comes (We actually don't encrypt passwords which is strange, but it is not me who makes those decissions). Now, this implementation is not well planned because since we have many threads we end up in a situation where we only log WARN level for this database class. I have now eliminated this problem. Thanks Henrik -Ursprungligt meddelande- Från: Bradley, Todd [mailto:[EMAIL PROTECTED] Skickat: den 4 april 2005 17:06 Till: Log4J Users List Ämne: RE: Log4J stops logging That is strange. Have you already tried turning on log4j debug output to see if somebody's resetting or re-reading the configuration that you don't know about? Todd. -Original Message- From: Henrik Engert [mailto:[EMAIL PROTECTED] Sent: Monday, April 04, 2005 3:30 AM To: log4j-user@logging.apache.org Subject: Log4J stops logging Hi, We have a problem with our application that uses Log4j. All of a sudden it stops logging INFO level and only keeps on logging DEBUG level. If I restart the application it works fine for a while then it stops. We are using Log4J version 1.2.8 and Java 1.4. We initialize Log4J with a property file like this: log4j.rootCategory=3DDEBUG, FILE log4j.appender.FILE=3Dorg.apache.log4j.RollingFileAppender log4j.appender.FILE.File=3D/bookit/prod/dataBI30/log/z3970.log log4j.appender.FILE.MaxFileSize=3D30MB log4j.appender.FILE.MaxBackupIndex=3D4 log4j.appender.FILE.layout=3Dorg.apache.log4j.PatternLayout log4j.appender.FILE.layout.ConversionPattern=3D%d %-4r [%t] %-5p %c %x - %m%n We are not resetting the log4J anywhere in the code or it's treshold. Any ideas? Regards, Henrik Engert ### This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange. For more information, connect to http://www.f-secure.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ### This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange. For more information, connect to http://www.f-secure.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Log4J stops logging
That is strange. Have you already tried turning on log4j debug output to see if somebody's resetting or re-reading the configuration that you don't know about? Todd. -Original Message- From: Henrik Engert [mailto:[EMAIL PROTECTED] Sent: Monday, April 04, 2005 3:30 AM To: log4j-user@logging.apache.org Subject: Log4J stops logging Hi, We have a problem with our application that uses Log4j. All of a sudden it stops logging INFO level and only keeps on logging DEBUG level. If I restart the application it works fine for a while then it stops. We are using Log4J version 1.2.8 and Java 1.4. We initialize Log4J with a property file like this: log4j.rootCategory=3DDEBUG, FILE log4j.appender.FILE=3Dorg.apache.log4j.RollingFileAppender log4j.appender.FILE.File=3D/bookit/prod/dataBI30/log/z3970.log log4j.appender.FILE.MaxFileSize=3D30MB log4j.appender.FILE.MaxBackupIndex=3D4 log4j.appender.FILE.layout=3Dorg.apache.log4j.PatternLayout log4j.appender.FILE.layout.ConversionPattern=3D%d %-4r [%t] %-5p %c %x - %m%n We are not resetting the log4J anywhere in the code or it's treshold. Any ideas? Regards, Henrik Engert ### This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange. For more information, connect to http://www.f-secure.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]