logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bin Yan" <bx...@health.state.ny.us>
Subject Re: UNIX file handler problem used up on log4j log files
Date Fri, 30 Aug 2002 17:03:00 GMT

Hi, Jin:

logName is Not dynamically generated. We have serveral log names mapped
with a configuration file.

this is a piece of them:

##############################################################################
# A category for logging field not found in Table XXXX
##############################################################################

#log4j.category.fldnotfound=DEBUG,fldnotfoundlog
#log4j.category.fldnotfound=INFO,fldnotfoundlog
log4j.category.fldnotfound=WARN,fldnotfoundlog
#log4j.category.fldnotfound=ERROR,fldnotfoundlog
#log4j.category.fldnotfound=FATAL,fldnotfoundlog
log4j.additivity.fldnotfound=false
log4j.appender.fldnotfoundlog=org.apache.log4j.RollingFileAppender
log4j.appender.fldnotfoundlog.File=${workingApps}/xxxx/logs/fldnotfound.log
log4j.appender.fldnotfoundlog.MaxFileSize=100KB
log4j.appender.fldnotfoundlog.MaxBackupIndex=3
log4j.appender.fldnotfoundlog.layout=org.apache.log4j.PatternLayout
log4j.appender.fldnotfoundlog.layout.ConversionPattern=%d - %m%n

>From Ceki's comments, I suspect the problem is that we don't init the
PropertyConfigurator only once. We use it every time a servlet is hit and
MyLog is newed.  For each user, we do put this in session and when hits get
high, eventually the file handler will get used up.

Regards,

Tony




                                                                                         
                                             
                      Jin Zhao                                                           
                                             
                      <JZhao@Qcorps.com        To:       Log4J Users List <log4j-user@jakarta.apache.org>
                             
                      >                        cc:                                    
                                                
                                               Subject:  Re: UNIX file handler problem used
up on log4j log files                      
                      08/30/2002 12:03                                                   
                                             
                      PM                                                                 
                                             
                      Please respond to                                                  
                                             
                      "Log4J Users                                                       
                                             
                      List"                                                              
                                             
                                                                                         
                                             
                                                                                         
                                             




is the value of "logName" is dynamically created? How many such
"logName" values will be created in your running apps?
How did you configure file appenders for these "logName"s?
It might be better to post a piece of your log4j configuration file so
that people can know how you configure loggers/appenders.

Jin

On Friday, August 30, 2002, at 08:36  AM, Bin Yan wrote:

>
> Thanks for the reply. Currently, that's how we do it, very simply:
>
>  theLog = Category.getInstance(logName.toString());
>
>     if (..... ) {
>         theLog.fatal(theMessage);
>
> }
>
>
>
>
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>  Tony Yan (Bin)
>  BHNSM/DOH/NYS
>  Tel: 518-473-1809
>  Email: bxy02@health.state.ny.us
>
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
>
>
>
>
>
>                       Ceki Gülcü
>                       <ceki@qos.ch>            To:       "Log4J Users
> List" <log4j-user@jakarta.apache.org>
>                                                cc:
>                       08/30/2002 09:28         Subject:  Re: UNIX file
> handler problem used up on log4j log files
>                       AM
>                       Please respond to
>                       "Log4J Users
>                       List"
>
>
>
>
>
>
> At 08:52 30.08.2002 -0400, you wrote:
>> I have a problem with file handler in UNIX. It is related to log4j, but
> may
>> not caused by it.
>>
>> There are two web applications running, both using log4j. One is
>> Solaris/Weblogic and the other
>> Solaris/iPlanet. The WL one never had problem with file logging. But
>> the
>> iPlanet always will have overflow file handler issue and eventually
>> after
>> days the UNIX file resources is used up and appl. get locked.
>>
>> I understand log4j is thread safe. I also checked the code of log4j. It
>> seems that the files (appenders) get opened and kept open until
>> specifically get reset() or close(). My question is that
>>
>> (a) Should we close the appenders each event is logged? Or we should
>> justleave them open.
>
> No, that would be excruciatingly slow.
>
>> (b) For the file hander of UNIX, for one file (appender) why would it
>> use
>> multiple handler for one file? why not use kind of pooling access to
>> the
>> file.
>
> How do you configure the appenders? Do you dynamically create a large
> number of appenders without ever closing them?
>
>> Please clarify if I have any misunderstandins.
>>
>>
>> Tony Yan
>
> --
> Ceki
>
>
> --
> To unsubscribe, e-mail:   <mailto:log4j-user-
> unsubscribe@jakarta.apache.org
>>
> For additional commands, e-mail: <mailto:log4j-user-
> help@jakarta.apache.org
>>
>
>
>
>
>
>
> --
> To unsubscribe, e-mail:   <mailto:log4j-user-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:log4j-user-
> help@jakarta.apache.org>
>

--
To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org
>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org
>






--
To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>


Mime
View raw message