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] [Comment Edited] (LOG4J2-1540) The Core AbstractManager should track its LoggerContext
Date Fri, 26 Aug 2016 00:40:20 GMT

    [ https://issues.apache.org/jira/browse/LOG4J2-1540?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15438177#comment-15438177
] 

Gary Gregory edited comment on LOG4J2-1540 at 8/26/16 12:39 AM:
----------------------------------------------------------------

For this next step I see two approaches:

- The APIs that take {{String name, T factoryData}} * can be changed to add a {{Configuration}},
then at the right time, the code can call {{Configuration.getLoggerContext()}} when it is
time to build an {{AbstractManager}} subclass. Or,
- All factory data classes can add a {{Configuration}} (or {{LoggerContext}}) field. As above,
The LC is fed to ctors when building managers.

Core APIs like:
- OutputStreamManager.getManager(String, T, ManagerFactory<? extends OutputStreamManager,
T>)
- AbstractManager.getManager(String, ManagerFactory<M, T>, T)
- createManager(String, T)

Would become:

- OutputStreamManager.getManager(Configuration, String, T, ManagerFactory<? extends OutputStreamManager,
T>)
- AbstractManager.getManager(Configuration, String, ManagerFactory<M, T>, T)
- createManager(Configuration, String, T)

At the root of this change and like the change for {{AbstractConfiguration}}, the ctor for
{{AbstractManager}} will change from {{AbstractManager(final String name)}} to {{AbstractManager(final
LoggerContext loggerContext, final String name)}}.

Thoughts?

Gary


was (Author: garydgregory):
For this next step I see two approaches:

- The APIs that take {{String name, T factoryData}} * can be changed to add a {{Configuration}},
then at the right time, the code can call {{Configuration.getLoggerContext()}} when it is
time to build an {{AbstractManager}} subclass. Or,
- All factory data classes can add a {{Configuration}} (or {{LoggerContext}}) field. As above,
The LC is fed to ctors when building managers.

Core APIs like:
- OutputStreamManager.getManager(String, T, ManagerFactory<? extends OutputStreamManager,
T>)
- AbstractManager.getManager(String, ManagerFactory<M, T>, T)
- createManager(String, T)

Would become:

- OutputStreamManager.getManager(Configuration, String, T, ManagerFactory<? extends OutputStreamManager,
T>)
- AbstractManager.getManager(Configuration, String, ManagerFactory<M, T>, T)
- createManager(Configuration, String, T)

Thoughts?

Gary

> 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
>
> The class in Core, {{AbstractManager}}, should track its {{LoggerContext}}.



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