Log4J and Netty 4

537 views
Skip to first unread message

Kimathie

unread,
Mar 17, 2016, 3:00:07 AM3/17/16
to Netty discussions
Hi 
We have distributed system , with one of our services using Netty 4.0.33 Final. Each service has a designated logger configured in the Log4j. 
We have been using Log4j and Netty for our 1st version of the system and it has been working well using our designated logger. 

For the second version of our system we have changed our configurations and we have renamed the log4j.properties file to our platform_name.properties and we have set the system property -Dlog4j.configuration indicating the location of the log4j file, we have set  PropertyConfigurator.configure(....)  pointing to the renamed properties file and I have set the 
InternalLoggerFactory.setDefaultFactory(new Log4JLoggerFactory()); 

When we start all the services , all of them start up well but the particular service embedded with Netty throws the error 

log4j:WARN No appenders could be found for logger (io.netty.util.internal.logging.InternalLoggerFactory).
log4j:WARN Please initialize the log4j system properly.

Where could we be going wrong ?

Kind regards

Kimathie

Norman Maurer

unread,
Mar 17, 2016, 5:18:23 AM3/17/16
to ne...@googlegroups.com
Hey Kimathie,

I’m afraid I have no idea how to fix this :( We not doing anything special but just use:

Logger.getLogger(name)

I wonder if we would need to accept a LoggerFactory as well that you could pass in. Any idea ?


--
You received this message because you are subscribed to the Google Groups "Netty discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netty+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netty/686444ce-b92f-48c2-9078-2eabf5c52800%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jordi Gerona

unread,
Mar 17, 2016, 6:20:09 AM3/17/16
to ne...@googlegroups.com

Hi Kimathie,

PropertyConfigurator.configure(....) + InternalLoggerFactory.setDefaultFactory(new Log4JLoggerFactory()); is the first thing you do when starting your application? This happened to me when messing with default log4j.properties file, when I was issuing log calls before configuring it

Message has been deleted

Kimathie

unread,
Mar 18, 2016, 12:04:06 PM3/18/16
to Netty discussions
Yes that would be superb, kinda like Jetty's log delegation.

Kimathie

unread,
Mar 18, 2016, 12:04:06 PM3/18/16
to Netty discussions
I'm executing in that order and yes it is the 1st thing I do. I'm still playing around with the code and configurations to see maybe if my code is the one that is causing this strange occurrence. 
Reply all
Reply to author
Forward
0 new messages