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

Log4J Composite Configuration #968

Closed
rkoshak opened this issue Sep 5, 2019 · 2 comments
Closed

Log4J Composite Configuration #968

rkoshak opened this issue Sep 5, 2019 · 2 comments

Comments

@rkoshak
Copy link
Contributor

rkoshak commented Sep 5, 2019

When I upgraded to 2.5 M2 I noticed that I had a ton more logging statements in openhab.log from usual. I had some customization in org.pax.logging.cfg which thankfully didn't get overwritten and therefore I missed some additions to the file. What would be really nice is if I could maintain my own customization to the logging in /etc/openhab2/services or the like and the OH provided one imports it.

This got me to thinking and I did somewhat of a deep dive into OPS4J Pax Logging, Log4j2, and Karaf. I believe this is possible. I believe it's possible if we switch to an XML config (see https://svn.apache.org/repos/asf/karaf/site/production/manual/latest/log.html under Log4j v2 support) as we can then use XInclude to import the files. It is supposed to be possible using .properties files too (https://logging.apache.org/log4j/2.x/manual/configuration.html#CompositeConfiguration) but I could never get it to work and couldn't find any examples to help. I wonder if there is something in Pax that breaks the log4j.configurationFile property.

Before I spend any more time on this, if I cannot in the end figure out how to make this work using the current .properties files, would a PR that converts the config to XML be accepted? Obviously, if I can make it work with properties files I'll stick with that to have less disruption.

@mhilbush
Copy link

mhilbush commented Sep 5, 2019

See #516. There's already an issue for this. And, there's even bounty on it! 😉

@rkoshak
Copy link
Contributor Author

rkoshak commented Sep 5, 2019

I swear I searched. I must have used the wrong words. Thanks! I'll move over to that issue.

@rkoshak rkoshak closed this as completed Sep 5, 2019
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

2 participants