[prev in list] [next in list] [prev in thread] [next in thread] 

List:       struts-user
Subject:    Re: logging system initialization
From:       "Ed Griebel" <edgriebel () gmail ! com>
Date:       2006-10-30 21:25:09
Message-ID: acf1f8940610301325i5044bdaaod1e6de62200b663c () mail ! gmail ! com
[Download RAW message or body]

...but note that unless you are dong something fancy, log4j doesn't
need any separate initialization steps as long as the log4j config
file is set up properly and in the classpath so log4j's static
initializer can find it.

One problem I have run into before is when there are two log4j.xml
files in the classpath, the first one log4j finds is what is used,
which is probably not the one intended.

-ed

On 10/30/06, Chris Pratt <thechrispratt@gmail.com> wrote:
> If you need to initialize anything before the rest of the system gets a hold
> of it (like logging), use a javax.servlet.ServletContextListener and process
> the contextInitialized() event.  It gets called before anything else in the
> context gets initialized.
>   (*Chris*)
>
> On 10/30/06, Ed Griebel <edgriebel@gmail.com> wrote:
> >
> > For a WAR file you are going to deploy: create a log4j.properties or a
> > log4j.xml file and get it into your warfile under WEB-INF/classes. The
> > actual process of doing this differs if you are using Maven, an IDE
> > deployer (e.g. JDeveloper or WSAD), or Ant to generate and deploy a
> > WAR.
> >
> > For a webapp running within an IDE, you will need to put the file in a
> > directory in your deployed application's classpath. This is highly
> > specific based on what IDE and plugins you are using, but usually this
> > will be the WEB-INF/classes directory. It could also be placed in an
> > arbitrary directory and the webapp's classpath should then include
> > this arbitrary classpath.
> >
> > If this has nothing to do with a webapp, then it is not even
> > tangentially a Struts issue but you will still want to create a
> > log4j.properties or log4j.xml file and have that on the classpath when
> > executing whatever app you are using.
> >
> > HTH,
> > -ed
> >
> > On 10/30/06, Ping Yu <ping_milsun@yahoo.com> wrote:
> > > People in the list,
> > >
> > >   I have my own log.java, and I would like to make a call to my own log
> > definitions before initialize/using the digester (
> > org.apache.commons.digester.Digester). However, I have no idea how to call
> > my own log first. Any suggestions? Thank you very much!
> > >
> > >   Right now, I am always getting the log4j warning.
> > >
> > >   Ping
> > >
> > >
> > >
> > > ---------------------------------
> > > Get your email and see which of your friends are online - Right on
> > the  new Yahoo.com
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic