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.
| 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. |
|
|
|
ActiveForums 3.7
|