On Tue, Mar 29, 2016 at 12:19 PM, Nipuni Perera <nip...@wso2.com> wrote:

> 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?
>
>
To enable the asynchronous logging with log4j2 in c5, we need to add some
properties, see [1] so I also think we need to finalize and add those
logging related configurations to a centralized file.

[1].
http://arunasujith.blogspot.com/2016/03/how-to-enable-asynchronous-logging-with.html


> [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
>
>


-- 

*Aruna Sujith Karunarathna *
WSO2, Inc | lean. enterprise. middleware.
#20, Palm Grove, Colombo 03, Sri Lanka
Mobile: +94 71 9040362 | Work: +94 112145345
Email: ar...@wso2.com | Web: www.wso2.com
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to