logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Strasser Christoph" <christoph.stras...@vinzenzgruppe.at>
Subject FallbackErrorHandler in properties File
Date Wed, 05 Jul 2006 13:11:29 GMT
Hi there,

 

I'm using a propertiesfile to configure my logger-object! So, the
configuration works like this:

PropertyConfigurator.configure("src/log4j_JDBCTest.properties");


logger = Logger.getLogger("log4jstandardtest");

 

the propertiesfile looks like this:

log4j.logger.log4jstandardtest=DEBUG, standard

log4j.appender.standard=org.apache.log4j.jdbcplus.JDBCAppender

log4j.appender.standard.url=jdbc:odbc:SWING_S

log4j.appender.standard.dbclass=sun.jdbc.odbc.JdbcOdbcDriver

log4j.appender.standard.username=""

log4j.appender.standard.password=""

log4j.appender.standard.sql=INSERT INTO Log4J_Standard (name, ts,
message, class_method, logLevel) VALUES
('standard','@LAYOUT:1@','@MSG@','@LAYOUT:5@','@LAYOUT:2@')

log4j.appender.standard.layout=org.apache.log4j.PatternLayout

log4j.appender.standard.layout.ConversionPattern=%d{dd.MM.yyyy
HH:mm:ss.SSS}#%5p#[%t]#%m#%C{1}.%M%n

log4j.appender.standard.layoutPartsDelimiter=#

log4j.appender.standard.buffer=1

log4j.appender.standard.commit=true

log4j.appender.standard.quoteReplace=true

 

So, as you can see, i'm using a JDBCAppender! What I want to add now to
my propertiesfile is, that an alternative appender (a
RollingFileAppender), getting used when the database is down or
unreachable! I found out, that the FallbackErrorHandler offers methods
that allow a primary and a backup appender. But i can't find out how to
integrate such an errorhandler in my properties file!

Can anyone help me with this problem?

 

thanks in advance,

Christoph


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message