[jboss-jira] [JBoss JIRA] (WFCORE-1512) DelegatingBasicLogger could delegate to a Logger provider

Jean-Francois Denise (JIRA) issues at jboss.org
Wed Apr 27 12:39:00 EDT 2016


    [ https://issues.jboss.org/browse/WFCORE-1512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13198005#comment-13198005 ] 

Jean-Francois Denise commented on WFCORE-1512:
----------------------------------------------

I was thinking that performance would be impacted. So it seems that it is not a good idea... Feel free to close if you think that it is not relevant.
Thanks.


> DelegatingBasicLogger could delegate to a Logger provider
> ---------------------------------------------------------
>
>                 Key: WFCORE-1512
>                 URL: https://issues.jboss.org/browse/WFCORE-1512
>             Project: WildFly Core
>          Issue Type: Feature Request
>          Components: Logging
>            Reporter: Jean-Francois Denise
>            Assignee: James Perkins
>
> Today the DelegatingBasicLogger subclass generated from @MessageLogger annotation is bound to a Logger at construction time. It could be of interest (e.g: I ran by accident on WFCORE-1187) to have the logger to be resolved dynamically.
> I didn't evaluate the impact on the logging project/tools/performances of a solution like the following but it captures the idea of a logger provider.
> public class DelegatingBasicLogger {
> public interface LoggerProvider
> { public Logger getLogger(); }
> DelegatingBasicLogger(Logger logger) {
> { this(()->{return logger;})}
> DelegatingBasicLogger(LoggerProvider provider)
> { this.provider = provider; }
> ....
> }
> A subclass could use LogContext to retrieve the right Logger.
> class MyLogger extends DelegatingBasicLogger {
> MyLogger(String category)
> { super(()->LogContext.getLogContext().getLogger()); }



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list