Log4J logging

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Log4J logging

Doug-10
Hi all,

     This may seem like a simple question, but I can't figure out how to do it.
 I  have downloaded Jetty 5.1.4 on my machine and installed it without a
problem.  In my application (the Jetty server is embedded into it), I already
use the log4j for logging any messages.  I would also like to have all of my
Jetty jsp messages go to the same log.

     Note: I already read the documentation about using the XML file to specify
the Log4j.  However, I would prefer to have the log4J logging setting done in
the code, rather than the xml file.

     This is equivalent of how I'm doing the request log internally by using the
code:

            String requestLogFilename = baseDir + "log/yyyy_mm_dd_request.log";
            NCSARequestLog requestLog = new NCSARequestLog(requestLogFilename);
            server.setRequestLog(requestLog);

Is there an equivalent way of doing this with the jetty internal logger?

Doug



-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Log4J logging

Greg Wilkins-5

Doug,

Jetty 5 uses commons logging for it's internal logging.
You should be able to configure that to use log4j and then configure that
programatically..... but you'll have to check the documentation of both
to work out exactly what to do.

cheers


Doug wrote:

> Hi all,
>
>      This may seem like a simple question, but I can't figure out how to do it.
>  I  have downloaded Jetty 5.1.4 on my machine and installed it without a
> problem.  In my application (the Jetty server is embedded into it), I already
> use the log4j for logging any messages.  I would also like to have all of my
> Jetty jsp messages go to the same log.
>
>      Note: I already read the documentation about using the XML file to specify
> the Log4j.  However, I would prefer to have the log4J logging setting done in
> the code, rather than the xml file.
>
>      This is equivalent of how I'm doing the request log internally by using the
> code:
>
>             String requestLogFilename = baseDir + "log/yyyy_mm_dd_request.log";
>             NCSARequestLog requestLog = new NCSARequestLog(requestLogFilename);
>             server.setRequestLog(requestLog);
>
> Is there an equivalent way of doing this with the jetty internal logger?
>
> Doug
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
> July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
> core and dual graphics technology at this free one hour event hosted by HP,
> AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

RE: Log4J logging

Doug-10
In reply to this post by Doug-10
Thanks, Greg... Unfortunately, I had already checked the documentation.
The only documentation that I found related to putting the settings in
the xml file. I'm trying to figure out how to do it in the code (not via
the XML file setup).

Doug

-----Original Message-----
From: Greg Wilkins [mailto:[hidden email]]
Sent: Tuesday, July 26, 2005 11:37 AM
To: [hidden email]
Subject: Re: Log4J logging



Doug,

Jetty 5 uses commons logging for it's internal logging.
You should be able to configure that to use log4j and then configure
that programatically..... but you'll have to check the documentation of
both to work out exactly what to do.

cheers


Doug wrote:
> Hi all,
>
>      This may seem like a simple question, but I can't figure out how
> to do it.  I  have downloaded Jetty 5.1.4 on my machine and installed
> it without a problem.  In my application (the Jetty server is embedded

> into it), I already use the log4j for logging any messages.  I would
> also like to have all of my Jetty jsp messages go to the same log.
>
>      Note: I already read the documentation about using the XML file
> to specify the Log4j.  However, I would prefer to have the log4J
> logging setting done in the code, rather than the xml file.
>
>      This is equivalent of how I'm doing the request log internally by

> using the
> code:
>
>             String requestLogFilename = baseDir +
"log/yyyy_mm_dd_request.log";
>             NCSARequestLog requestLog = new
NCSARequestLog(requestLogFilename);

>             server.setRequestLog(requestLog);
>
> Is there an equivalent way of doing this with the jetty internal
> logger?
>
> Doug
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by the 'Do More With Dual!' webinar
> happening July 14 at 8am PDT/11am EDT. We invite you to explore the
> latest in dual core and dual graphics technology at this free one hour

> event hosted by HP, AMD, and NVIDIA.  To register visit
> http://www.hp.com/go/dualwebinar



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. <a href="http://ads.osdn.com/?ad_idt77&alloc_id492&op=click">http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss