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

Broken Logging #72

Open
thoebert opened this issue Mar 5, 2022 · 0 comments
Open

Broken Logging #72

thoebert opened this issue Mar 5, 2022 · 0 comments

Comments

@thoebert
Copy link

thoebert commented Mar 5, 2022

Thank you for your work at the Openllet project!

I found a bug in the module-shared/src/openllet/shared/tools/Log.java and was generally wondering about the logging architecture.

First, all lower level class loggers are currently renamed to the simple class name without their package prefix Logger.getLogger(type.getSimpleName()). Therefore it is not possible to configure these loggers in a hierarchical way, for example to change the log level of all loggers of a specific subpackage. Instead, type.getName() should be used to use the regular naming scheme with package prefix to enable this.

Similarly, the forced _defaultLevel=Level.INFO in production code for all loggers makes a regular logger configuration via logging properties file impossible. If this setting of the logging level is necessary in testcases, a direct modification of the specific logger (Logger.getLogger(MyTestedClass.class).setLevel(Level.Fine)) or via testcase-specific logging configuration file (System.setProperty("java.util.logging.config.file", ClassLoader.getSystemResource("logging.properties").getPath())) should be used instead.

I am also unsure, what the purpose of the selfmade toSlf4j-Adapter is. SLF4J offers adapters for this purpose which can be integrated during run-time to remove the direct dependency to SLF4J (see here). So, in my opinion, there should be either a complete replacement of the Java 1.6 Logging API with the generic SLF4J-API, or removing this adapter and leaving the rerouting to the users with the slf4j adapter jul-to-slf4j.jar.

Thank you!

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