Return-Path: Delivered-To: apmail-logging-log4j-user-archive@www.apache.org Received: (qmail 965 invoked from network); 24 Apr 2009 16:09:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Apr 2009 16:09:09 -0000 Received: (qmail 41874 invoked by uid 500); 24 Apr 2009 16:09:06 -0000 Delivered-To: apmail-logging-log4j-user-archive@logging.apache.org Received: (qmail 41829 invoked by uid 500); 24 Apr 2009 16:09:06 -0000 Mailing-List: contact log4j-user-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Users List" Reply-To: "Log4J Users List" Delivered-To: mailing list log4j-user@logging.apache.org Received: (qmail 41639 invoked by uid 99); 24 Apr 2009 16:09:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Apr 2009 16:09:06 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of rmenon.us@gmail.com designates 74.125.44.154 as permitted sender) Received: from [74.125.44.154] (HELO yx-out-1718.google.com) (74.125.44.154) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Apr 2009 16:08:55 +0000 Received: by yx-out-1718.google.com with SMTP id 36so671060yxh.40 for ; Fri, 24 Apr 2009 09:08:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=0a8tf/7bISRo5u5pbWFSm0owm650iEjC8F2dNkvkvX4=; b=bNVEiScKntcwCFbvzavlRVn2Q8zPvo3KF0d20pjmGRX8kxgqKT232zQZOH29lp7vfZ id1VrZRU0kX3oLxj0udUJuar9v7cG23/iVixO2WI4HPxNxNOJTgtfp62VUP07D7IUcLX YFTFtAW4reLqlwZFKWMtuj3MU6U/M+Qfc36iM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=XNmGKO68kNTR0p7OU8qj3DPZlagSP7VbQmeP/QiJS8oU3sR5L1OLWBIVpOQFX5rggv ZwoxDnRpKcIkF32l6WO1zOq+bfJCMnrVbxEQk4fZMHSPWjb5lsoz5HtsDTrWKBVsbRaZ 7j+iPeArQ7HSTVWW80ytgk/tywpMAMcwi2NUs= MIME-Version: 1.0 Received: by 10.90.90.4 with SMTP id n4mr2858698agb.7.1240589313875; Fri, 24 Apr 2009 09:08:33 -0700 (PDT) In-Reply-To: <44B76DF56DE7A843BB5E8109DC4EEB1204D5A00148@sbapexch05> References: <6cd2a1a0904240807w67b48480k15be533c756e005e@mail.gmail.com> <44B76DF56DE7A843BB5E8109DC4EEB1204D5A000E1@sbapexch05> <6cd2a1a0904240826k14250054gbe7020998f757c2a@mail.gmail.com> <44B76DF56DE7A843BB5E8109DC4EEB1204D5A00148@sbapexch05> Date: Fri, 24 Apr 2009 09:08:33 -0700 Message-ID: <6cd2a1a0904240908i344bfa14qa09c4835def5ffc5@mail.gmail.com> Subject: Re: Log4j exception Could not close org.apache.log4j.helpers.CountingQuietWriter From: ramakrishna menon To: Log4J Users List Content-Type: multipart/alternative; boundary=0016361648995d9ed704684f35bb X-Virus-Checked: Checked by ClamAV on apache.org --0016361648995d9ed704684f35bb Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit As far as I know if I use an editor to open a log file then that should not lock it for the application... As I mentioned, even though the file is on a shared NFS, no other application is accessing/writing to the same log4j file. I have the habit of creating separate directory for each web application. A tomcat hosting another application running on another server also uses log4j and writes to the shared NFS but to a different directory structure. The application is multi-threaded so it is possible that multiple threads are writing to the same log4j file - but since log4j is multi-threaded that should not be an issue. Any further thoughts or workarounds? Thank you, Menon ----------------------------------------------------------- R. M. Menon - A Rafi fan(www.mohdrafi.com) Author, Expert Oracle JDBC Programming, http://www.amazon.com/exec/obidos/tg/detail/-/159059407X/ ----------------------------------------------------------- On Fri, Apr 24, 2009 at 8:59 AM, Matt Brown wrote: > I'm not really up on the internals of RollingFileAppender, but I would bet > that the file residing on a shared NFS directory is in fact the cause of the > problem. This log message (which is just logged at INFO, and isn't truly an > exception being thrown outside of log4j) is indicating that log4j could not > close the file, which I believe it is necessary to do to rename it. > > I'd assume the file could not be closed / renamed because someone was > accessing it on the shared location and possibly even had it locked. > > -----Original Message----- > From: ramakrishna menon [mailto:rmenon.us@gmail.com] > Sent: Friday, April 24, 2009 11:26 AM > To: Log4J Users List > Subject: Re: Log4j exception Could not close > org.apache.log4j.helpers.CountingQuietWriter > > Sure - thank you for a super prompt response! Here is my log4j > configuration. The directory in which the application writes is a shared NFS > directory if it makes any difference. But no other vm (tomcat) or > application is writing to this directory... > # log4j properties file > #log4j.debug=true > log4j.rootLogger=WARN, R > # > log4j.appender.R=org.apache.log4j.RollingFileAppender > log4j.appender.R.File=/data/etl/ssm/extractor/logs/extractor.log > log4j.appender.R.MaxFileSize=20MB > log4j.appender.R.MaxBackupIndex=30 > log4j.appender.R.layout=org.apache.log4j.PatternLayout > log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %c - %m%n # > log4j.logger.com.opinmind=DEBUG > log4j.logger.org.apache.commons.digester=debug > > > ----------------------------------------------------------- > R. M. Menon - A Rafi fan(www.mohdrafi.com) Author, Expert Oracle JDBC > Programming, http://www.amazon.com/exec/obidos/tg/detail/-/159059407X/ > ----------------------------------------------------------- > > > On Fri, Apr 24, 2009 at 8:10 AM, Matt Brown >wrote: > > > Can you share your log4j configuration? > > > > -----Original Message----- > > From: ramakrishna menon [mailto:rmenon.us@gmail.com] > > Sent: Friday, April 24, 2009 11:08 AM > > To: log4j-user@logging.apache.org > > Subject: Log4j exception Could not close > > org.apache.log4j.helpers.CountingQuietWriter > > > > Hi I have a web application installed on a single tomcat instance. > > > > After around 2 to 5 days of running, the entire application stalls. > > When checking the log, I get the following error stack. I did some > > research on this on google but could not find any solution. What can I > > do to avoid this situation? A tomcat bounce typically resolves the > situation temporarily. > > > > Thank you! > > Menon > > Apr 23, 2009 11:40:40 PM org.apache.catalina.core.StandardWrapperValve > > invoke > > INFO: log4j:ERROR Could not close > > org.apache.log4j.helpers.CountingQuietWriter@11361f82 > > java.io.IOException: Input/output error > > at java.io.FileOutputStream.close0(Native Method) > > at java.io.FileOutputStream.close(FileOutputStream.java:279) > > at > > sun.nio.cs.StreamEncoder$CharsetSE.implClose(StreamEncoder.java:431) > > at sun.nio.cs.StreamEncoder.close(StreamEncoder.java:160) > > at java.io.OutputStreamWriter.close(OutputStreamWriter.java:222) > > at java.io.FilterWriter.close(FilterWriter.java:92) > > at org.apache.log4j.FileAppender.closeFile(FileAppender.java:183) > > at > > > org.apache.log4j.RollingFileAppender.rollOver(RollingFileAppender.java:146) > > at > > > > > org.apache.log4j.RollingFileAppender.subAppend(RollingFileAppender.java:239) > > at org.apache.log4j.WriterAppender.append(WriterAppender.java:159) > > at > > org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:230) > > at > > > > > org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:65) > > at org.apache.log4j.Category.callAppenders(Category.java:203) > > at org.apache.log4j.Category.forcedLog(Category.java:388) > > at org.apache.log4j.Category.debug(Category.java:257) > > at > > com.opinmind.db.DbUtil.executeDbProcAffectingRows(DbUtil.java:244) > > at > > > > > com.opinmind.webapp.exporter.AbstractExporter.logExtractorStats(AbstractExporter.java:139) > > at > > > > > com.opinmind.webapp.exporter.ExporterAssumingClientOnDbImpl.generateFile(ExporterAssumingClientOnDbImpl.java:138) > > at > > > > > com.opinmind.webapp.etl.extractor.DbDataExporter.getFiles(DbDataExporter.java:65) > > at > > > > > com.opinmind.webapp.etl.extractor.action.ExtractDbDataIntoFileAction.doExecute(ExtractDbDataIntoFileAction.java:71) > > at > com.opinmind.webapp.action.BaseAction.execute(BaseAction.java:50) > > at > > > > > org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58) > > at > > > > > org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67) > > at > > > > > org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51) > > at > > org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190) > > > > ----------------------------------------------------------- > > R. M. Menon - A Rafi fan(www.mohdrafi.com) Author, Expert Oracle JDBC > > Programming, http://www.amazon.com/exec/obidos/tg/detail/-/159059407X/ > > ----------------------------------------------------------- > > ----------------------------------------------------------- > > R. M. Menon - A Rafi fan(www.mohdrafi.com) Author, Expert Oracle JDBC > > Programming, http://www.amazon.com/exec/obidos/tg/detail/-/159059407X/ > > ----------------------------------------------------------- > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org > > For additional commands, e-mail: log4j-user-help@logging.apache.org > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org > For additional commands, e-mail: log4j-user-help@logging.apache.org > > --0016361648995d9ed704684f35bb--