加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – Elmah max日志条目

发布时间:2020-12-16 01:52:50 所属栏目:百科 来源:网络整理
导读:我将 Elmah生成的异常保存为XML文件. 有没有办法配置它,以便它自动删除超过X天的文件?或者目录中的最大文件数量?或者我是否需要创建一个自定义批处理作业来执行此操作? 解决方法 从 Elmah Project Site到 ErrorLogImplementations.(斜体添加强调) XmlErro
我将 Elmah生成的异常保存为XML文件.

有没有办法配置它,以便它自动删除超过X天的文件?或者目录中的最大文件数量?或者我是否需要创建一个自定义批处理作业来执行此操作?

解决方法

从 Elmah Project Site到 ErrorLogImplementations.(斜体添加强调)

XmlErrorLog

The XmlFileErrorLog stores errors into loose XML files in a configurable directory. Each error gets its own file containing all of its details. The files can easily be copied around,deleted,compressed or mailed to someone for further diagnostics. It does not require any database engine or setup,like with SQL Server and Oracle,so there is very little management overhead and you do not need to worry about additional costs when it comes to hosting plans. Although simple,it relies on the file system performance for shredding through the directory,reading files and sorting through them. A smart way of keeping logs based on XmlFileErrorLog running smoothly is to limit the number of files by scheduling a task to periodically archive the old logs and clean up the folder.

您需要创建一个执行此操作的自定义批处理作业.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读