Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] Logging implementations


Petar,

we don't code against the SimpleLogger API.  Jetty uses it's own Logger API and it will log to stderr if there is no log jars available.    If you only provide the slf4j->log4j2 jar, then jetty logging will detect that as an slf4j log and will use that instead.

If you want to avoid slf4j entirely, you could also write an instance of the Jetty logger that goes direct to log4j2.

cheers




On 12 January 2014 23:55, Petar Tahchiev <paranoiabla@xxxxxxxxx> wrote:
Hi guys,

I'm using the jetty-maven-plugin version 8.1.14.v20131031 and during startup I get this:

---------
[DEBUG] Logging to org.slf4j.impl.SimpleLogger(org.eclipse.jetty.util.log) via org.eclipse.jetty.util.log.Slf4jLog
---------

My application however uses Log4j2 as a logging implementation of slfj4. So instead of having:

log4j -routed to-> log4j2
jcl    -routed to -> log4j2
slf4j -routed to -> log4j2
jul    -routed to -> slf4j -routed to -> log4j2

i correctly get the output of log4j,jcl and log4j2,
but the jul and the slf4j do not get routed to log4j2!!!
As a result I have to configure now both - log4j and slf4j!!!

I don't think it's correct of you to log everything to SimpleLogger - this way you force the user to use the slf4j as their logging implementation. I think you should code against the slf4j-api and then ask the user to select whatever implementation they like.

Any suggestions on how to overcome this are welcome.

--
Regards, Petar!
Karlovo, Bulgaria.
---
Public PGP Key at: https://keyserver1.pgp.com/vkd/DownloadKey.event?keyid=0x19658550C3110611
Key Fingerprint: A369 A7EE 61BC 93A3 CDFF  55A5 1965 8550 C311 0611

_______________________________________________
jetty-dev mailing list
jetty-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-dev



Back to the top