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] [Commented] (LOG4J2-859) Use an AtomicReference for AbstractLifeCycle to make a finite state machine
Date Thu, 25 Sep 2014 14:53:34 GMT

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

Gary Gregory commented on LOG4J2-859:
-------------------------------------

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: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message