Friday, May 18, 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: XML configuration, windows service
Prev Next
You are not authorized to post a reply.

Author Messages
Aleš Vojácek

07/17/2008 2:11 PM  

Hi all,
I'm using

[assembly: log4net.Config.XmlConfigurator(ConfigFileExtension = "conflog", Watch = true)]

in AssemblyInfo.cs

Almost everything works fine.
When I started service without config file there is no problem, simply service does not generate log.
Then I add config file into service directory, again everything works fine, it starts logging.
If I change config file then the configuration change and again everything is ok.

But when I delete config file then service still loging, I hoped that it stops logging.

How to do that, I know that it can be done using change config file
instead of deleting it, but I need some more simple solution, because it
wil be used by our customers which has no knowledge about editing files.
I hoped that I will send them config file, which they simply copy into
app directory, then they send me log file back and then delete config
file. All without restarting service.

Can you someone help me with that?

A.

Rennie Petersen

07/17/2008 4:00 PM  

Two suggestions:

1. The right way: In your service's admin program (I'm assuming it has one?) include support for cranking logging up and down using a drop-down box on the GUI, and sending the info to the service program which modifies the XML config file. This requires support in the admin program and the service program, but makes things very user-friendly - the customer does not even need to copy a settings file, they just crank logging up, wait a while, crank logging down and send you the log file.

2. A possible quick-and-dirty solution: Send your customers two XML config files, one to start logging and one to stop it.

Rennie

Aleš Vojácek

07/17/2008 4:06 PM  

Hi,
thx for your post ;-)
we are doing it like your solution 2.
We have no gui cof for that service, but, we will add one soon, so we
can add there.

Best Regards A.
Rennie Petersen napsal(a):

You are not authorized to post a reply.
Forums > Log4Net > Log4Net Mail archive > XML configuration, windows service



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