You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Ken Baltrinic <ke...@inforeliance.com> on 2004/09/28 02:14:36 UTC

Need FallbackErrorHandler Example

I am trying to setup log4j to use a FileAppender as a fall back appender
for a JDBCAppender.  Are there some examples or documentation I could
look at?  

 

I took a crack at it but I am getting the warning: log4j:WARN Failed to
set property [backupAppender] to value "LocalFileAppender".

 

The relevant xml snippet look like this:

 

  <appender name="LocalFileAppender"
class="org.apache.log4j.FileAppender">

    <param name="file"
value="C:\\Sun\\AppServer\\domains\\domain1\\logs\\logging-output.xml"/>

    <layout class="org.apache.log4j.xml.XMLLayout"/>

  </appender>

 

  

  <appender name="JDBCAppender"
class="org.apache.log4j.jdbcplus.JDBCAppender">

            

    <errorHandler class="org.apache.log4j.varia.FallbackErrorHandler">

      <param name="BackupAppender" value="LocalFileAppender"/>

    </errorHandler>

 

            . . . 

 

  </appender>

    

 

Thanks for help,

--Ken


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.766 / Virus Database: 513 - Release Date: 17.09.2004



RE: Need FallbackErrorHandler Example

Posted by Ivan Jouikov <iv...@ablogic.net>.
My only thought is creating your own appender, which would wrap both JDBC and file appenders, and try to instantiate one, and if it wails - try to instantiate the other.

> -----Original Message-----
> From: Ken Baltrinic [mailto:ken.baltrinic@inforeliance.com]
> Sent: Monday, September 27, 2004 5:15 PM
> To: Log4J Users List
> Subject: Need FallbackErrorHandler Example
> 
> I am trying to setup log4j to use a FileAppender as a fall back appender
> for a JDBCAppender.  Are there some examples or documentation I could
> look at?
> 
> 
> 
> I took a crack at it but I am getting the warning: log4j:WARN Failed to
> set property [backupAppender] to value "LocalFileAppender".
> 
> 
> 
> The relevant xml snippet look like this:
> 
> 
> 
>   <appender name="LocalFileAppender"
> class="org.apache.log4j.FileAppender">
> 
>     <param name="file"
> value="C:\\Sun\\AppServer\\domains\\domain1\\logs\\logging-output.xml"/>
> 
>     <layout class="org.apache.log4j.xml.XMLLayout"/>
> 
>   </appender>
> 
> 
> 
> 
> 
>   <appender name="JDBCAppender"
> class="org.apache.log4j.jdbcplus.JDBCAppender">
> 
> 
> 
>     <errorHandler class="org.apache.log4j.varia.FallbackErrorHandler">
> 
>       <param name="BackupAppender" value="LocalFileAppender"/>
> 
>     </errorHandler>
> 
> 
> 
>             . . .
> 
> 
> 
>   </appender>
> 
> 
> 
> 
> 
> Thanks for help,
> 
> --Ken
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.766 / Virus Database: 513 - Release Date: 17.09.2004
> 
> 
> 
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.766 / Virus Database: 513 - Release Date: 17.09.2004
> 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.766 / Virus Database: 513 - Release Date: 17.09.2004
 


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