启用/禁用企业库登录生产 [英] Enable/Disable Enterprise Library logging on production

查看:135
本文介绍了启用/禁用企业库登录生产的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的生产,我不希望有严重性详细(或调试)日志条目。我只需要的信息,错误是什么等等启用和禁用日志记录(调试项目),正确的方法?

On my production, I don't want to have log entry with severity Verbose (or Debug). I need only the info, error etc. What is the right method to enable and disable logging (the debug entries)?

我做了一些研究,一个可能性是使用自定义过滤器类启用和禁用严重性详细的所有日志。但是,当生产部署应用程序,什么是允许和禁止的正确方法?

I did some research and one possibility is to use Custom Filter class to enable and disable all logs with severity "verbose". But When deploying application on production, what is the right way to enable and disable?

推荐答案

您可以设置日志级别,在您的配置文件,这样一来,如果你需要它在生产中因任何原因,你可以在任何时候打开它。

You can set your logging level in your config file, that way, should you need it in production for whatever reason, you can switch it on at any time.

这篇关于启用/禁用企业库登录生产的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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