登录log4net,单日日志 [英] Logging in log4net , single log for single day

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

问题描述

大家好,我遇到了这样的问题:
我需要在适当的日期存储在某些文件夹日志文件中.
也许任何人都知道以这种方式配置log4net很热,这样他就可以一天创建一个日志文件??

对我来说很重要.
谢谢.

Hi guys , i encountered with such problem:
i need to store in some folder logs file for appropriate day.
Maybe anyone knows hot to configure log4net, in such way, that he can creates a single log file for a day???

It''s very important for me.
Thanks.

推荐答案

您将要创建RollingFileAppender,然后根据日期更改文件.这是我在log4net上的教程,其中包括指定的附加程序: log4net教程 [ http://stackoverflow. com/questions/533804/append-current-date-to-log-file-with-log4net [
You would want to create a RollingFileAppender and then change the file based upon the date. Here is my tutorial on log4net, which includes the specified appender: log4net Tutorial[^]

You would just need to change it to use date instead of size for changing the file. Here is an example of how to do that: http://stackoverflow.com/questions/533804/append-current-date-to-log-file-with-log4net[^]


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

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