Click here to Skip to main content
15,902,032 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Can I use log4net in my web service? If so can I have a sample? I have successfully tried it with a web form application (.Net 3.5).
Posted

If you have successfully tried it in a webform application there's nothing keeping you from using it in a webservice. What problems are you having? Just add a log4net configuration section to your webconfig file the same as you would do with your application config file.

Regards,

Manfred
 
Share this answer
 
v2
Comments
fadia jabeen 21-Feb-17 5:32am    
Location of intializing the log4net instance. As there is no Main() method in a web service.
I have just added
log4net.Config.XmlConfigurator.Configure(); 
in the Application_Start event of global.asax.

Thanks
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900