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

Loggers should be declared non-static #969

Closed
ViToni opened this issue Jan 19, 2020 · 2 comments · Fixed by #970
Closed

Loggers should be declared non-static #969

ViToni opened this issue Jan 19, 2020 · 2 comments · Fixed by #970

Comments

@ViToni
Copy link
Contributor

ViToni commented Jan 19, 2020

Loggers are declared as private static final. This can have impact when having the library deployed on "shared" classpaths.
It is prefereable to have them non-static.
If you care about serialization Loggers could be changed to be also transient.

For reference see:
http://slf4j.org/faq.html#declared_static
https://cwiki.apache.org/confluence/display/COMMONS/Logging+StaticLog

Projects implementing such a policy:
https://www.eclipse.org/smarthome/documentation/development/guidelines.html#e-logging
https://www.openhab.org/docs/developer/guidelines.html#f-logging

(Have to admit these projetcs are closely related but both are supposed to support dynamic reloading of JARs/ bundles.)

@ViToni ViToni changed the title Loggers should declared non-static Loggers should be declared non-static Jan 19, 2020
@marci4
Copy link
Collaborator

marci4 commented Jan 19, 2020

@ViToni thx for pointing this out.
We do not plan serialize the logger.

Pull request welcome!

@ViToni
Copy link
Contributor Author

ViToni commented Jan 20, 2020

Created PR #970.

@marci4 marci4 added this to the Release 1.4.1 milestone Mar 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants