You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Ralph Goers (JIRA)" <ji...@apache.org> on 2014/03/01 19:20:19 UTC

[jira] [Assigned] (LOG4J2-469) FailoverAppender does not retry back for Primary target

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

Ralph Goers reassigned LOG4J2-469:
----------------------------------

    Assignee: Ralph Goers

> FailoverAppender does not retry back for Primary target
> -------------------------------------------------------
>
>                 Key: LOG4J2-469
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-469
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 2.0-beta9
>         Environment: JBoss 6.1.1, Spring-MVC, Log4j2 beta-9, Windows 7, Eclipse Kelper
>            Reporter: Indrajit Pingale
>            Assignee: Ralph Goers
>              Labels: features
>
> Hi,
>      In my product, I am using log4j2 for logging onto MySQL database. For that I am using JDBC as Primary and RollingRandomAccessFile as Secondary Appender.
>      It works well and logs goes to Secondary appender when Primary appender fails (due to MySQL connection lost). But when MySQL connection comes back, it does not logs back to MySQL until I restart the JBoss Server.
>     Is this a expected behavior? Or I am missing something in configuration file.
> Following is the my log4j2.xml file.
> {code:xml}
>     <?xml version="1.0" encoding="UTF-8"?>
> <Configuration status="error">
> 	<Appenders>
> 		<JDBC name="databaseAppender" tableName="system_log" ignoreExceptions="false" bufferSize="10">
> 			<DriverManager url="jdbc:mysql://localhost:3306/xxxid_db"
> 				username="root" password="xxxxxxwing" />
> 			<Column name="log_id" pattern="%x" />
> 			<Column name="log_dated" isEventTimestamp="true" />
> 			<Column name="log_logger" pattern="%logger" />
> 			<Column name="log_level" pattern="%level" />
> 			<Column name="log_message" pattern="%message" />
> 			<Column name="log_throwable" pattern="%ex{full}" />
> 		</JDBC>
> 		<RollingRandomAccessFile name="RollingRandomAccessFile"
> 			fileName="${sys:jboss.server.log.dir}/app.log" filePattern="${sys:jboss.server.log.dir}/$${date:yyyy-MM}/app-%d{MM-dd-yyyy}-%i.log.gz">
> 			<PatternLayout>
> 				<Pattern>%d %p %c{1.} [%t] %m%n</Pattern>
> 			</PatternLayout>
> 			<Policies>
> 				<TimeBasedTriggeringPolicy />
> 				<SizeBasedTriggeringPolicy size="250 MB" />
> 			</Policies>
> 		</RollingRandomAccessFile>
> 		<Failover name="Failover" primary="databaseAppender" ignoreExceptions="false">
> 			<Failovers>
> 				<AppenderRef ref="RollingRandomAccessFile" />
> 			</Failovers>
> 		</Failover>
> 	</Appenders>
> 	<Loggers>
> 		<Root level="warn">
> 			<AppenderRef ref="Failover" />
> 		</Root>
> 	</Loggers>
> </Configuration>
> {code}
> Thank You,
> Indrajit



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org