[Jetty-support] Jetty 6.0 logging using Log4J

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

[Jetty-support] Jetty 6.0 logging using Log4J

Guy-21
Hi,

in the archives, i found:

"In jetty6, we use our own logging interface. This either routes to our
 own logging implementation o.m.log.StdErrLog , or to a an SLF4J plugin
 log via our o.m.log.Slf4JLog class.

 If you run it out of the box, our own log implementation will be used,
 and all debug will go to stderr.

 If you want logging to go anywhere else, you include one of the SLF4J
 logging implementations on the classpath, and configure that in
 whatever way the particular impl needs."

so i downloaded "slf4j-1.1.0-RC1.zip" and added
slf4j-log4j12-1.1.0-RC1.jar, slf4j-api-1.1.0-RC1.jar and
log4j-1.2.11.jar to the classpath. I am using the following
log4j.properties:

log4j.rootCategory=INFO, Default

log4j.appender.Default=org.apache.log4j.FileAppender
log4j.appender.Default.file=jetty.log
log4j.appender.Default.layout=org.apache.log4j.PatternLayout
log4j.appender.Default.layout.ConversionPattern=%d{ISO8601} %-5p [%c] - %m%n
log4j.appender.Default.append=false


As you can see, i am not trying anything fancy.

If i do not add the 3 jar files, the StdErrLog is used, but if i add
the 3 jar files, i get no logging at all.

What am i missing?

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: [Jetty-support] Jetty 6.0 logging using Log4J

Guy-21
Sorry guys,

problem solved. I am embarressed to admit it was the location of the
log4j.properties file...

next newbie who want to enable logging: beware of this :-)

Guy

On 11/17/06, Guy <[hidden email]> wrote:

> Hi,
>
> in the archives, i found:
>
> "In jetty6, we use our own logging interface. This either routes to our
>  own logging implementation o.m.log.StdErrLog , or to a an SLF4J plugin
>  log via our o.m.log.Slf4JLog class.
>
>  If you run it out of the box, our own log implementation will be used,
>  and all debug will go to stderr.
>
>  If you want logging to go anywhere else, you include one of the SLF4J
>  logging implementations on the classpath, and configure that in
>  whatever way the particular impl needs."
>
> so i downloaded "slf4j-1.1.0-RC1.zip" and added
> slf4j-log4j12-1.1.0-RC1.jar, slf4j-api-1.1.0-RC1.jar and
> log4j-1.2.11.jar to the classpath. I am using the following
> log4j.properties:
>
> log4j.rootCategory=INFO, Default
>
> log4j.appender.Default=org.apache.log4j.FileAppender
> log4j.appender.Default.file=jetty.log
> log4j.appender.Default.layout=org.apache.log4j.PatternLayout
> log4j.appender.Default.layout.ConversionPattern=%d{ISO8601} %-5p [%c] - %m%n
> log4j.appender.Default.append=false
>
>
> As you can see, i am not trying anything fancy.
>
> If i do not add the 3 jar files, the StdErrLog is used, but if i add
> the 3 jar files, i get no logging at all.
>
> What am i missing?
>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: [Jetty-support] Jetty 6.0 logging using Log4J

jan_bartel
Guy,

That's what I was going to ask you - where is your log4j.properties file?

If I had 10 cents for every time I myself have forgotten to put my log4j.properties
file somewhere ... well, I'd be able to keep myself supplied with coffee
for a long long time :-)

Jan

Guy wrote:

> Sorry guys,
>
> problem solved. I am embarressed to admit it was the location of the
> log4j.properties file...
>
> next newbie who want to enable logging: beware of this :-)
>
> Guy
>
> On 11/17/06, Guy <[hidden email]> wrote:
>> Hi,
>>
>> in the archives, i found:
>>
>> "In jetty6, we use our own logging interface. This either routes to our
>>  own logging implementation o.m.log.StdErrLog , or to a an SLF4J plugin
>>  log via our o.m.log.Slf4JLog class.
>>
>>  If you run it out of the box, our own log implementation will be used,
>>  and all debug will go to stderr.
>>
>>  If you want logging to go anywhere else, you include one of the SLF4J
>>  logging implementations on the classpath, and configure that in
>>  whatever way the particular impl needs."
>>
>> so i downloaded "slf4j-1.1.0-RC1.zip" and added
>> slf4j-log4j12-1.1.0-RC1.jar, slf4j-api-1.1.0-RC1.jar and
>> log4j-1.2.11.jar to the classpath. I am using the following
>> log4j.properties:
>>
>> log4j.rootCategory=INFO, Default
>>
>> log4j.appender.Default=org.apache.log4j.FileAppender
>> log4j.appender.Default.file=jetty.log
>> log4j.appender.Default.layout=org.apache.log4j.PatternLayout
>> log4j.appender.Default.layout.ConversionPattern=%d{ISO8601} %-5p [%c] - %m%n
>> log4j.appender.Default.append=false
>>
>>
>> As you can see, i am not trying anything fancy.
>>
>> If i do not add the 3 jar files, the StdErrLog is used, but if i add
>> the 3 jar files, i get no logging at all.
>>
>> What am i missing?
>>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support
>


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: [Jetty-support] Jetty 6.0 logging using Log4J

Tim Vernum

On 18/11/2006, at 2:40 AM, Jan Bartel wrote:

> If I had 10 cents for every time I myself have forgotten to put my  
> log4j.properties
> file somewhere ... well, I'd be able to keep myself supplied with  
> coffee
> for a long long time :-)

I keep running into situations where a project has 5 copies of  
log4j.xml in it, and I
can't work out which one is being used in my tests. I have to change  
them all, one by
one, to work out which one I want :(


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: [Jetty-support] Jetty 6.0 logging using Log4J

Ceki Gulcu-2
At 10:31 PM 11/17/2006, you wrote:

>On 18/11/2006, at 2:40 AM, Jan Bartel wrote:
>
> > If I had 10 cents for every time I myself have forgotten to put my
> > log4j.properties
> > file somewhere ... well, I'd be able to keep myself supplied with
> > coffee
> > for a long long time :-)
>
>I keep running into situations where a project has 5 copies of
>log4j.xml in it, and I
>can't work out which one is being used in my tests. I have to change
>them all, one by
>one, to work out which one I want :(

Tooting logback's horn, we mitigate this problem by searching for the
configuration file logback-test.xml first and only of it fails search for
logback.xml. How is this relevant? Well, because assuming the
logback-test.xml files are not included in the final packaging of your
project, you have fewer config files to suspect.

Just my 2c.


--
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support