logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam K" <ada...@gmail.com>
Subject Re: Log4J +struts
Date Thu, 14 Dec 2006 22:27:02 GMT
I'm using this but I have 2 questions (yet again).

1) How do I know if the class is being picked up properly, as I don't see
any errors in the logs files
2) How do I go about using the logger within the application - that is how
do I get a handle to it ?

again thanks for all the help.


On 12/14/06, James Stauffer <stauffer.james@gmail.com> wrote:
>
> If you name your file "log4j.xml" and if is accessible in the
> classpath (i.e. WEB-INF/classes), then log4j will automatically find
> it and configure itself with it.
>
> On 12/14/06, Adam K <adamk1@gmail.com> wrote:
> > See the "Default Initialization Procedure" section at
> > http://logging.apache.org/log4j/docs/manual.html
> >
> > I have looked at this, but am now more confused than previously.  (Part
> of
> > the problem is that I tried to use parts for that page which obviously
> > resulted in disaster.
> >
> > I was looking around and found the following:
> >
> http://mail-archives.apache.org/mod_mbox/logging-log4j-user/200207.mbox/%3C8426231879.20020717150829@visi.com%3E
> >
> > and would like to clarify the steps that I should be following (thanks
> for
> > your patience with me on this one).
> >
> > 1) add log4j.jar to WEB-INF/lib/    -- COMPLETE
> > 2) create a log4jConfiguration.xml file and place it in
> /WEB-INF/src/java/
> > ------COMPLETE When compiled the file is appearing under
> /WEB-INF/classes
> >
> >  The following is the xml file
> >
> > <?xml version="1.0" encoding="UTF-8" ?>
> > <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
> >
> > <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
> >   <appender name="console" class="org.apache.log4j.ConsoleAppender">
> >     <param name="Target" value="System.out"/>
> >     <layout class="org.apache.log4j.PatternLayout">
> >       <param name="ConversionPattern" value="%-5p %c{1} - %m%n"/>
> >     </layout>
> >   </appender>
> >
> >   <root>
> >     <priority value ="debug" />
> >     <appender-ref ref="console" />
> >   </root>
> >
> > </log4j:configuration>
> >
> > At this point I am wondering if I should be doing something similar to
> what
> > is mentioned in the e-mail archive that I borrowed.  Again if you can
> advise
> > me I would really appreciate it.
> >
> > thanks again for your time and effort.
> >
> >
>
>
> --
> James Stauffer        http://www.geocities.com/stauffer_james/
> Are you good? Take the test at http://www.livingwaters.com/good/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message