tomcat configuration - jndi selector initialization printed three times

Hi, just tried to set up logging with logback on tomcat6. When I start tomcat with my webapplication I get the message from the jndi context selector "searching for mylogback.xml" followed with status information lines 3 times within my catalina.out (the timestamps are the same) and wonder if this as expected? What I did: - copied logback core, classic, access and the slf4j api libraries to tomcats lib folder. I added the valve to the server.xml (but no logback-access.xml right now). I added the "-Dlogback.ContextSelector=JNDI" within setenv.sh. Within web.xml I added the filter and listener as recommended, added both jndi env entries as stated within chapter 9. There is just one webapp running currently, but need to set up same webapp within same tomcat multiple times. Did I missed anything or do you have any idea why the message is displayed three times? Many thanks in advance Markus ___________________________________________________________ WEB.DE DSL Doppel-Flat ab 19,99 €/mtl.! Jetzt mit gratis Handy-Flat! http://produkte.web.de/go/DSL_Doppel_Flatrate/2

Hello Markus, Logback-access requires the Tomcat valve. Are you confusing logback-access and the JNDIContextSelector? The latter is a logback-classic feature and independent of logback-access. Is there a copy of slf4-api.jar or logback-classic.jar in your web-app? On 25/01/2011 8:52 PM, Markus Meisters wrote:
Hi,
just tried to set up logging with logback on tomcat6. When I start tomcat with my webapplication I get the message from the jndi context selector "searching for mylogback.xml" followed with status information lines 3 times within my catalina.out (the timestamps are the same) and wonder if this as expected?
What I did: - copied logback core, classic, access and the slf4j api libraries to tomcats lib folder. I added the valve to the server.xml (but no logback-access.xml right now). I added the "-Dlogback.ContextSelector=JNDI" within setenv.sh.
Within web.xml I added the filter and listener as recommended, added both jndi env entries as stated within chapter 9.
There is just one webapp running currently, but need to set up same webapp within same tomcat multiple times.
Did I missed anything or do you have any idea why the message is displayed three times?
Many thanks in advance Markus

Hi,
Logback-access requires the Tomcat valve. Are you confusing logback-access and the JNDIContextSelector?
I want to get access log and webapplications (with jndi separation) running.
The latter is a logback-classic feature and independent of logback-access. Is there a copy of slf4-api.jar or logback-classic.jar in your web-app?
not that I'm aware of :} because the goal also was to avoid to have tem within the app, but will check again. btw. wenn I deploy the logback-demo webapp within the tomcat6 I see the message 2 times Could this be related to threads? Many thanks in advance Markus ___________________________________________________________ Neu: WEB.DE De-Mail - Einfach wie E-Mail, sicher wie ein Brief! Jetzt De-Mail-Adresse reservieren: https://produkte.web.de/go/demail02

Hi Markus, ContextSelectors intervene during logger retrieval. However, since logback-access does not have a notion of loggers, ContextSelectors do not work with logback-access. You could use filters to separate logs per web-app. As for status information appearing twice, do you have both a status listeners and debug set to true in your config file? Cheers, -- Ceki On 25/01/2011 9:06 PM, Markus Meisters wrote:
Hi,
Logback-access requires the Tomcat valve. Are you confusing logback-access and the JNDIContextSelector?
I want to get access log and webapplications (with jndi separation) running.
The latter is a logback-classic feature and independent of logback-access. Is there a copy of slf4-api.jar or logback-classic.jar in your web-app?
not that I'm aware of :} because the goal also was to avoid to have tem within the app, but will check again.
btw. wenn I deploy the logback-demo webapp within the tomcat6 I see the message 2 times
Could this be related to threads?
Many thanks in advance Markus
participants (2)
-
Ceki Gülcü
-
Markus Meisters