Hi all,

In C5 we use java.util.logging as the logging framework in launcher module.
Java util logging uses a configuration file in JRE/lib/logging.properties
file as the default configuration. In order to use a custom configuration
file we need to set a system property (java.util.logging.config.file) as
mentioned in the description in [1].
After setting this property we can change the log level of root logger by
setting
".level = <LEVEL>"

Or we can specify handlers and change the log level of each handler as
below,

handlers= org.wso2.carbon.launcher.bootstrap.logging.ConsoleLogHandler,
org.wso2.carbon.launcher.bootstrap.logging.FileLogHandler

org.wso2.carbon.launcher.bootstrap.logging.ConsoleLogHandler.level = FINE

org.wso2.carbon.launcher.bootstrap.logging.FileLogHandler.level = INFO


(Log level of the root logger need to be lower than that of handlers to
control the log level of handlers. eg: If we need to log the FINE logs to
console, log level of root logger has to be FINE or lower level than FINE)
Hence if need to control the log level of java util logging, we need to
have a separate configuration file. (We had maintained a similar
configuration in carbon 4  in
repository/conf/etc/logging-bridge.properties).

There are few other issues that we need to fix at code level even after
adding the above configuration file:

   1.  We need to add the BootstrapLogger to LogManager. PR[2]. (LogManager
   read the logging configuration from file described above.)
   2.  We need to change the access modifiers of handler constructors to
   public, else trying to configure handlers log level via configuration will
   cause error[3]

I could configure the java.util.logging log levels after doing the changes
mentioned above.
Shall we add this logging.properties configuration to C5?

[1] https://wso2.org/jira/browse/CARBON-1574
<https://wso2.org/jira/browse/CARBON-15745>
[2] https://github.com/wso2/carbon-kernel/pull/902
[3] Can't load log handler
"org.wso2.carbon.launcher.bootstrap.logging.FileLogHandler"
java.lang.IllegalAccessException: Class java.util.logging.LogManager$5 can
not access a member of class
org.wso2.carbon.launcher.bootstrap.logging.FileLogHandler with modifiers
"private"5 <https://wso2.org/jira/browse/CARBON-15745>

Thanks,
Nipuni
-- 
Nipuni Perera
Software Engineer; WSO2 Inc.; http://wso2.com
Email: nip...@wso2.com
Git hub profile: https://github.com/nipuni
Blog : http://nipunipererablog.blogspot.com/
Mobile: +94 (71) 5626680
<http://wso2.com>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to