logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Gregory (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (LOG4J2-1540) The Core AbstractManager should track its LoggerContext
Date Fri, 26 Aug 2016 15:11:20 GMT

     [ https://issues.apache.org/jira/browse/LOG4J2-1540?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Gary Gregory resolved LOG4J2-1540.
----------------------------------
       Resolution: Fixed
    Fix Version/s: 2.7

All appenders created with a Configuration object in their respective factories now pass that
configuration's logger context to the managers they create. If an appender is not given a
Configuration, it cannot set the logger context for its manager and it will be null.

A future task could be to add Configurations to all appenders to that they can  pass logger
contexts to their managers. Does this fall in the YAGNI category or is it just odd that {{AbstractManager.getLoggerContext()}}
returns null if some advanced user needs it? IOW, should we update all of our own appenders
to take a Configuration?

> The Core AbstractManager should track its LoggerContext
> -------------------------------------------------------
>
>                 Key: LOG4J2-1540
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1540
>             Project: Log4j 2
>          Issue Type: New Feature
>            Reporter: Gary Gregory
>            Assignee: Gary Gregory
>             Fix For: 2.7
>
>
> The class in Core, {{AbstractManager}}, should track its {{LoggerContext}}.
> Add:
> {code:java}
>     /**
>      * Gets the logger context used to create this instance or null. The logger context
is usually set when an appender
>      * creates a manager and that appender is given a Configuration. Not all appenders
are given a Configuration by
>      * their factory method or builder.
>      * 
>      * @return the logger context used to create this instance or null.
>      */
>     public LoggerContext getLoggerContext()
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message