运行时的企业库日志记录配置 [英] Enterprise Library Logging Configuration at Runtime

查看:83
本文介绍了运行时的企业库日志记录配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我的问题很简单,但情况有点复杂.

我想在运行时配置Enterprise Lib Logging,该怎么做.

我有一个使用EntLib 3.1 Logger Application Block记录数据的库.现在,该库正在各种服务中使用,因此理想情况下,日志记录应使用每个服务的web.config中的配置设置.

现在我不想要那样,因为我的日志记录在所有服务中都是相同的,所以我想从单个配置加载记录器(可以从DLL的配置中加载,也可以在运行时为记录器加载配置).我已经尝试了所有可能的方法,如果有人对此主题有任何指导,请帮助我.

我经历了以下工作,但是这些对我没有用.

http://stackoverflow. com/questions/624436/can-i-change-the-configuration-of-the-enterprise-library-logging-block-at-runtim [ ^ ]

http://stackoverflow.com/questions/1771808/entlib-logging-add- edit-tracelisteners-runtime [ ^ ]

谢谢
Rushi

Hi All,

My question is simple but scenario is bit complex.

I want to configure Enterprise Lib Logging at runtime, how do I do that.

I have a library which is, logging data using EntLib 3.1 Logger Application Block. Now this library is being consumed in various services, so ideally logging should consume configuration setting from web.config of each services.

Now I don''t want that, as my logging is going to be same in all services so I want to load logger from single configuration (Either from config of DLL or can load config for logger at runtime). I tried my all possible way, please help me if someone has any direction in this subject.

I went through following stuff, but those are not useful for me.

http://stackoverflow.com/questions/624436/can-i-change-the-configuration-of-the-enterprise-library-logging-block-at-runtim[^]

http://stackoverflow.com/questions/1771808/entlib-logging-add-edit-tracelisteners-at-runtime[^]

Thanks
Rushi

推荐答案

也许这会给您一个开始 ^ ]
Perhaps this will give you a start Hierarchical Exception Handling with the Enterprise Library[^]


这篇关于运行时的企业库日志记录配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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