views:

482

answers:

2

Related to this question. It appears that Glassfish is exporting slf4j into my application and overriding my logging solution. Is it possible for me to override Glassfish's logging and have my own logging solution take precedence? After searching, I have only found ways to modify the log using logging.properties.

I am not married to my current implementation, but I am interested in making it work.

thanks.

+1  A: 
Pascal Thivent
This did not work as a workaround
kgrad
@krad I don't understand why this does not work. But thanks for the feedback. You should raise an issue IMHO.
Pascal Thivent
@Pascal Thivent - I brought it to the attention of #Glassfish on freenode, I believe some people are testing it out. The only thing I have heard so far is "it's likely a classloader order issue".
kgrad
@krad Well, that's the obvious part :)
Pascal Thivent
@Pascal Thivent - I have reported the issue: https://glassfish.dev.java.net/issues/show_bug.cgi?id=11683
kgrad
@kgrad Thank you very much for the feedback. Have a look at http://stackoverflow.com/questions/2418069/logback-with-ejb3-1/2418355#2418355, I've updated my answer.
Pascal Thivent
A: 

The short answer is, Glassfish does some nasty logger tweaking, redirecting System.out and System.err to its own log. I did not manage to stop it doing so, but I found a way to collect all server and application log messages in a single slf4j log by placing the slf4j libs early enough in the classpath and editing the logging.properties of Glassfish.

For the long answer, see this blog post.