[
https://issues.apache.org/jira/browse/LOG4J2-859?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Gary Gregory updated LOG4J2-859:
--------------------------------
Comment: was deleted
(was: I do not see a call to {{isStarted()}} in
{{org.apache.logging.log4j.core.appender.AbstractAppender.setHandler(ErrorHandler)}}:
{code:java}
/**
* The handler must be set before the appender is started.
* @param handler The ErrorHandler to use.
*/
@Override
public void setHandler(final ErrorHandler handler) {
if (handler == null) {
LOGGER.error("The handler cannot be set to null");
}
if (isStarted()) {
LOGGER.error("The handler cannot be changed once the appender is
started");
return;
}
this.handler = handler;
}
{code}
?)
> Use an AtomicReference for AbstractLifeCycle to make a finite state machine
> ---------------------------------------------------------------------------
>
> Key: LOG4J2-859
> URL: https://issues.apache.org/jira/browse/LOG4J2-859
> Project: Log4j 2
> Issue Type: Improvement
> Components: Core
> Affects Versions: 2.2
> Reporter: Matt Sicker
>
> I already showed off an example of how this would be done in git commit
> {{1a332afa33c55a72ae8ab5ec83cd5964de3fdc67}}. This would also provide error
> handling and proper state-setting in the start and stop methods.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]