Click here to Skip to main content
15,888,334 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
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.
Posted

1 solution

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[^]
 
Share this answer
 
Comments
Oleksandr Kulchytskyi 1-Jun-12 10:45am    
Thanks a lot Tim, you gave me a useful links !!! my 5 to you ;)
Manfred Rudolf Bihy 1-Jun-12 10:46am    
Good answer! 5+
VJ Reddy 1-Jun-12 13:26pm    
Good answer. 5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900