You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ping Yu <pi...@yahoo.com> on 2006/10/30 21:09:12 UTC
logging system initialization
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
Re: logging system initialization
Posted by Ed Griebel <ed...@gmail.com>.
...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 <th...@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 <ed...@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 <pi...@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
Re: logging system initialization
Posted by Chris Pratt <th...@gmail.com>.
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 <ed...@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 <pi...@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
>
>
Re: logging system initialization
Posted by Ping Yu <pi...@yahoo.com>.
Ed,
Right now commons-digester.jar is in the webapp's classpath, and so it is the jar file (management.jar) which includes my log file, but it still gets the log4j warning error message.
log4j:WARN No appenders could be found for logger (org.apache.catalina.startup.TldConfig).
log4j:WARN Please initialize the log4j system properly.
<classpathentry kind="lib" path="C:/ping/lib/management.jar"/>
<classpathentry kind="lib" path="WEB-INF/lib/commons-digester.jar"/>
I am using MyEclipse, and deploying the apps in my local machine. Should I do anything else? Thank you!
Ping
Ed Griebel <ed...@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
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
---------------------------------
Access over 1 million songs - Yahoo! Music Unlimited Try it today.
Re: logging system initialization
Posted by Ed Griebel <ed...@gmail.com>.
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 <pi...@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