Web服务中的log4net [英] log4net in web service

查看:98
本文介绍了Web服务中的log4net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在Web服务中使用log4net吗?如果可以,我可以拿样品吗?我已成功使用Web表单应用程序(.Net 3.5)进行了尝试.

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).

推荐答案

如果您已成功在Webform应用程序中进行了尝试,则没有什么可以保留的在Web服务中使用它.你有什么问题?只需将log4net配置部分添加到您的webconfig文件中,就像处理应用程序配置文件一样.

问候,

Manfred
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


我刚刚在global.asax的Application_Start事件中添加了
I have just added
log4net.Config.XmlConfigurator.Configure(); 

.

谢谢

in the Application_Start event of global.asax.

Thanks


这篇关于Web服务中的log4net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆