You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
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 adapterjul-to-slf4j.jar
.Thank you!
The text was updated successfully, but these errors were encountered: