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

Support logging when multiple spring-boot apps are deployed to the same JVM. #124

Closed
arunkpatra opened this issue Nov 10, 2015 · 4 comments

Comments

@arunkpatra
Copy link
Contributor

There's probably a way already to do this(as the issue title suggests) but here are my observations.

Consider the case where multiple spring-boot applications are deployed to the same JVM. Let's say all these apps use logback and are well configured. Their logging contexts would collide and would require usage of a <contextName>your_app_context_name</contextName> in the logback config file. This will cause the logback JMXConfigurator MBean to be registered as ch.qos.logback.classic:Name=your_app_context_name,Type=ch.qos.logback.classic.jmx.JMXConfigurator. Now code in applicationLogging.js of 'spring-boot-admin-server-ui' has this preset value:

var LOGBACK_MBEAN = 'ch.qos.logback.classic:Name=default,Type=ch.qos.logback.classic.jmx.JMXConfigurator';

This causes the obvious lookup failure for the MBean. Would it be possible to make this configurable and handle this use case?

Thanks in advance.

@joshiste
Copy link
Collaborator

How should the UI get to know the contextName?
We could look for an mbean with name equals to the registered application-name, if not found for name=default. This would force you to choose the application name as your contextName...

But I would really encourage you to not deploy multiple apps to the same JVM....

@arunkpatra
Copy link
Contributor Author

@joshiste I totally agree with you - it makes total sense to use seperate JVMs for production deployments. But for dev/integration/systest environments I would think quite a few users would be using a single JVM - and especially for these type of environments folks would like to tweak log levels to debug.

I like your thought of looking for a MBean with the user's app-name as the contextName.

Cheers!
Arun

@joshiste
Copy link
Collaborator

@arunkpatra Please try a snapshot to verify the solution works for you.

@arunkpatra
Copy link
Contributor Author

@joshiste Works like a charm! Muchos Gracias!

Arun

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

No branches or pull requests

2 participants