Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging Context not switching for the Static Logger in Shared Library using Context Discriminator #1

Open
vijay-sundareshwaran opened this issue May 10, 2017 · 0 comments

Comments

@vijay-sundareshwaran
Copy link

logback.txt
I am using the logback-starwars project and created the attached logback.xml which is placed in the tomcat/lib folder.

Both the kenobi and yoda applications have the following entries in the web.xml:

JNDI logging context for this app logback/context-name java.lang.String yoda logback/configuration-resource java.lang.String logback.xml

When I hit the URL: http://localhost:8080/kenobi/servlet, kenobi.log is created and I can see the following in the file:

DEBUG c.qos.starwars.kenobi.KenobiServlet kenobi - in doGet()
DEBUG ch.qos.starwars.shared.Mustafar kenobi - in Mustafarrrr foo()

Now, I hit URL http://localhost:8080/yoda/servlet, yoda.log gets created and has 1 log in it as:

DEBUG ch.qos.starwars.yoda.YodaServlet yoda - in doGet()

But, the Shared Library log is appended in to kenobi.log with the incorrect context as shown below:

DEBUG ch.qos.starwars.shared.Mustafar kenobi - in Mustafarrrr foo()

I have used the JNDI contextName variable in the logback.xml for switching the contexts, but the JNDIContext Discriminator doesnt seem to work here.

Can you please let me know if anything is incorrect here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant