Haresh created LOG4J2-3489:
------------------------------
Summary: The switch from secondary to primary does not happen for
RollingFileAppender in case of Failover
Key: LOG4J2-3489
URL: https://issues.apache.org/jira/browse/LOG4J2-3489
Project: Log4j 2
Issue Type: Bug
Components: Appenders
Affects Versions: 2.17.0
Reporter: Haresh
Scenario:
1) The FailoverAppender failed over from Primary (RollingFileAppender) to
secondary as Primary appender went down after some time
2) The Failover is appending to secondary and the primary is back up.
3) The FailoverAppender is not able to switch back to Primary. It fails with an
"IOException: Unexpected network error".
Possible solution: I set the outputstream of the RollingFileappender to null
when the writeToDestination method fails. With this, the appender constructs a
new OutputStream when it re-tries primary and starts working fine.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)