Saturday, February 04, 2012
 
The best way to analyze your logs! Minimize
 Log4Net Mail archive   

The Log4Net mailing list is a great source of information about using log4Net, in this forum we collect all the messages in the log4net user list and some selected threads from the developer list.

Subject: Redirecting Some Log Entries
Prev Next
You are not authorized to post a reply.

Author Messages
James Green

06/15/2009 2:42 PM  
Hi All,
 
I'm just creating a wrapper for my use.  The question I have is about redirecting or temporarily turning off appenders.
 
Say I have two appenders added to the over all config.  One is a simple file appender whilst the other is an Event log appender.
 
Most of the time I just want things to go to the file appender and on some occasions I want logs to just go to the EventLog.  The config is all being performed in code by creating the required appenders and then calling ActivateOptions().
 
How would I go about turning them on and off selectively in code? (C#).
 
Cheers,
 
James.
Mayne, Michael

06/15/2009 3:16 PM  

James,

You could try using a custom filter class that you attach to your appenders and that look s for the condition(s) you set for turning appending on/off.

 

Also, on a separate note, would you post your code for doing the logging programmatically? I’m trying to do the same thing for unit testing custom layouts, appenders and loggers.

Thanks

Michael

 

James Green

06/15/2009 3:23 PM  
I've actually just exposed some custom methods with adjust the eventlogappenders threashold level ... seems to work so far.  Will look into the filters suggestion.  Thanks,
 
Which part of code are you needing help with?
You are not authorized to post a reply.
Forums > Log4Net > Log4Net Mail archive > Redirecting Some Log Entries



ActiveForums 3.7

 

 

 

 

 

 

 

 

Log4Net Dashboard

Log analysis and monitoring made easy!

Log4Net Dashboard is a log viewer that can read log statements from a variety of logging output targets.

You can download a free developer version.

  

Check it out!

On the demonstration site you can try it  with live data.demo.l4ndash.com - Try Log4Net Dashboard with live data

The mail archive is a copy of all the mail sent to the mail address: log4net-user@logging.apache.org, organized as a forum.

If you would like to participate in the mail list, send a mail to log4net-user-subscribe@logging.apache.org.

More information about the mailing list is available on: http://logging.apache.org/log4net/support.html

 

A complete topic list is available and can be viewed here (warning, it takes some time to load)

 

Copyright 2005-2008 by FaktNet AS Terms Of Use Privacy Statement