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-1348) Add an AutoCloseable ThreadContext class: CloseableThreadContext
Date Mon, 04 Apr 2016 17:10:25 GMT

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

Gary Gregory resolved LOG4J2-1348.
----------------------------------
    Resolution: Fixed

Hi [~gdt]:

Thank you for your patch. Nice work.

I've applied your patch for some changes:

I've refactored the use of the ctors into factory methods, mostly because I found it confusing
to figure out when the stack or map was used. The class now has push and put static methods,
the public ctors are still public as I consider the choice a matter of personal style.

I've also fill in the missing Javadoc and tweaked the text.

Thank you for your contributions.

Please verify the code in Git master and close this ticket if/when satisfied.

Gary

> Add an AutoCloseable ThreadContext class: CloseableThreadContext
> ----------------------------------------------------------------
>
>                 Key: LOG4J2-1348
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1348
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: API
>            Reporter: Greg Thomas
>            Assignee: Gary Gregory
>            Priority: Minor
>         Attachments: CloseableThreadContext.zip
>
>
> The log4j2 API provides a ThreadContext - https://logging.apache.org/log4j/2.x/manual/thread-context.html
-  that allows items to be added to a stack or a map for logging, and then subsequently removed
once they are no longer required.
> This sounds like an ideal candidate for a AutoCloseable implementation so that items
are removed automatically and no longer left around littering the stack/map.



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