You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@logging.apache.org by "Chris Slater (JIRA)" <ji...@apache.org> on 2017/08/03 13:30:00 UTC

[jira] [Commented] (LOG4J2-1949) On failover from JDBC appender, contents of buffer are not written to failover appender

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

Chris Slater commented on LOG4J2-1949:
--------------------------------------

I did not change the LifeCycle interfaces in order to maintain backwards compatibility with implementations of those interfaces, some of which may not be in the log4j2 code base.  For example, I am using a custom appender that implements LifeCycle2, annotated with @Plugin.

If Java 8 became a requirement, perhaps a default method could be used.

> On failover from JDBC appender, contents of buffer are not written to failover appender
> ---------------------------------------------------------------------------------------
>
>                 Key: LOG4J2-1949
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1949
>             Project: Log4j 2
>          Issue Type: Bug
>    Affects Versions: 2.8.2
>            Reporter: Chris Slater
>         Attachments: LOG4J2-1949_LOG4J2-1951.patch
>
>
> With the following sample config:
> {code:xml}
>         <JDBC name="AuditLog-Database" tableName="audit" ignoreExceptions="false" bufferSize="250">
>             <ConnectionFactory class="com.example.MyConnectionFactory" method="getConnection"/>
>             <Column name="D_TIME" isEventTimestamp="true"/>
>             <ColumnMapping name="AUDIT_ID" pattern="%X{AUDIT.ID}"/>
>             <ColumnMapping name="AUDIT_MESSAGE" pattern="%X{AUDIT.MESSAGE}"/>
>         </JDBC>
>         <RollingFile name="AuditLog-Failover-File"
>                      fileName="${sys:env.home}/log/failover.log"
>                      filePattern="${sys:env.home}/log/failover.%d{yyyy-MM-dd}.log"
>                      ignoreExceptions="false">
>             <PatternLayout>
>                 <pattern>%d{ISO8601}| %X{AUDIT.ID}| %X{AUDIT.MESSAGE}%n</pattern>
>             </PatternLayout>
>             <Policies>
>                 <TimeBasedTriggeringPolicy />
>             </Policies>
>         </RollingFile>
>         <Failover name="AuditLog" primary="AuditLog-Database">
>             <Failovers>
>                 <AppenderRef ref="AuditLog-Failover-File"/>
>             </Failovers>
>         </Failover>
> {code}
> If the database fails, the contents of the buffer are not written to the failover log file.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)