How to use slf4j with log4j2

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

How to use slf4j with log4j2

Paladox
Hi, how do i use slf4j with log4j2 please? using it with log4j worked. but when i use it with log4j2 call getLoggers and it outputs, it shows no loggers other then the ones i define in a properties file. In log4j it showed the loggers even if they were not defined in a properties file.
Reply | Threaded
Open this post in threaded view
|

Re: How to use slf4j with log4j2

Matt Sicker
Loggers are lazily created. The only loggers you'll see that way would be
ones with specific configurations. What you may want to look more at are
the JMX APIs in log4j-core which show how to more easily obtain that sort
of metadata at runtime.

On 24 December 2017 at 06:01, Paladox <[hidden email]>
wrote:

> Hi, how do i use slf4j with log4j2 please? using it with log4j worked. but
> when i use it with log4j2 call getLoggers and it outputs, it shows no
> loggers other then the ones i define in a properties file. In log4j it
> showed the loggers even if they were not defined in a properties file.




--
Matt Sicker <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: How to use slf4j with log4j2

Ralph Goers
In reply to this post by Paladox
I’m a little confused. What class are you calling getLoggers() on? As far as I know SLF4J doesn’t have that method. As far as Log4j 2 goes, I thought I explained this in a prior email.

Ralph

> On Dec 24, 2017, at 5:01 AM, Paladox <[hidden email]> wrote:
>
> Hi, how do i use slf4j with log4j2 please? using it with log4j worked. but when i use it with log4j2 call getLoggers and it outputs, it shows no loggers other then the ones i define in a properties file. In log4j it showed the loggers even if they were not defined in a properties file.



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]