Subject: Re: URGENT!!!!! How to Shut off Struts Logging!!!
From: "Hyunjin Kim" <[EMAIL PROTECTED]>
 ===
Yup.. that's what i thought the problem would be after reading log4j FAQ
page..
and actually, in all my perform methods inside classes extending Action
class (the Model component), I do

BasicConfigurator.configure();   // configure log4j..

... Guess I am creating new instance of log4j EACH TIME AN MODEL COMPONENT
DOES SOMETHING!!!
ok.. that answers one of my questions.. and you are telling me that storing
log4j instance in aplication session and reuse it... right??

Well.. here's a new question:
If Struts is using log4j and it is affected by my log4j.properties file,
shouldn't we have access to the log4j Category instance?? since we can
always get to ActionServlet in EVERY model components that extends Action
class..???

Thanks!


"Wilson, Les J SI-FSIA" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Hi,
>
> Sounds like you are creating a new instance of the logger each time
instead
> of using the same one.
>
> We use an initialisation servlet to set up log4j and then do a
> Category.getInstance in our classes to get an instance of the logger to
log
> against.  We are not using the latest version of Log4J as Category has
been
> replaced by the Logger class.
>
> You could also try http://jakarta.apache.org/log4j/docs/manual.html
>
>
> Les
>
>
> -----Original Message-----
> From: Struts Newsgroup [mailto:[EMAIL PROTECTED]]
> Sent: 10 April 2002 10:55
> To: [EMAIL PROTECTED]
> Subject: Re: URGENT!!!!! How to Shut off Struts Logging!!!
>
>
> Subject: Re: URGENT!!!!! How to Shut off Struts Logging!!!
> From: "Hyunjin Kim" <[EMAIL PROTECTED]>
>  ===
> oh.. i added what you have taught me and the number of logging statements
> have decreased considerably...
>
> but it does not eliminated the core problem. -> it still loggs same
logging
> statement for number of times.. last time I saw the stdout log file, there
> was one instance of ERROR log statement appearing more than 1000 times!!!
>
> looking at the log4j document.. I couldn't find any solution... or i am
just
> not that smart to configure log4j properties file correctly...
>
>
> ANY HELP??
>
> "Will Jaynes" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]...
> > I had to add the following to log4j.properties:
> >
> > log4j.category.org.apache=ERROR
> >
> >
> > B.Adji Maharyatno wrote:
> >
> > > I put debug and detail to 0.
> > >
> > > Cheers.
> > > B. Adji Maharyatno
> > > Singapore
> > >
> > >
> > > -----Original Message-----
> > > From: Struts Newsgroup [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, April 09, 2002 1:10 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: URGENT!!!!! How to Shut off Struts Logging!!!
> > >
> > >
> > > Subject: URGENT!!!!! How to Shut off Struts Logging!!!
> > > From: "Hyunjin Kim" <[EMAIL PROTECTED]>
> > >  ===
> > > I am using struts 1.1b and log4j for my application, and struts is
> logging
> > > same statement for multiple times and number of times it logs are
> doubling
> > > each time a specific statement is called... and eventually, the number
> of
> > > times a specific logging statement is so large that the server just
> hangs...
> > >
> > >
> > > here's my code web.xml file where i configured Action Servlet...
> > >
> > >
> > > <servlet>
> > >     <servlet-name>action</servlet-name>
> > >
> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
> > >     <init-param>
> > >       <param-name>config</param-name>
> > >       <param-value>/WEB-INF/struts-config.xml</param-value>
> > >     </init-param>
> > >     <init-param>
> > >   <param-name>application</param-name>
> > >   <param-value>ApplicationResources</param-value>
> > >  </init-param>
> > >     <init-param>
> > >       <param-name>debug</param-name>
> > >       <param-value>1</param-value>
> > >     </init-param>
> > >     <init-param>
> > >       <param-name>detail</param-name>
> > >       <param-value>1</param-value>
> > >     </init-param>
> > >     <load-on-startup>2</load-on-startup>
> > >   </servlet>
> > >
> > >
> > > and my log4j properties file...
> > >
> > > log4j.rootCategory=DEBUG, A1
> > >
> > > # A1 is set to be a RollingFileAppender.
> > > log4j.appender.A1=org.apache.log4j.RollingFileAppender
> > > log4j.appender.A1.File=../logs/nanoenc_application.log
> > >
> > > log4j.appender.A1.MaxFileSize=5000KB
> > > # Keep one backup file
> > > log4j.appender.A1.MaxBackupIndex=10
> > >
> > >
> > > # Print the date in ISO 8601 format
> > > # like 2000-09-07 14:07:41,508 [main] INFO  MyApp - Entering
> application.
> > > log4j.appender.A1.layout=org.apache.log4j.PatternLayout
> > > log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
> > >
> > > # for individual classes, try the following line.
> > > log4j.category.com.nanoenc=ERROR
> > > log4j.category.biz.itline=ERROR
> > >
> > >
> > >
> > > How can I stop Struts to keep doubling number of times it's
> logging???????
> > >
> > > any help from struts/log4j gurus will be REALLY appreciated!!
THANKS!!!
> > >
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> > > <mailto:[EMAIL PROTECTED]>
> > >
> > > --
> > > To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >
>
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to