I am using log4net for logging service in my Outlook Add-In. How to configure it for creating one log per week and also I want to delete that log after a complete week.
Asked
Active
Viewed 374 times
0
-
2why would you want to do that? if the bug occurs an hour (or a minute) before the start of the new week, you lose all your logging. – user1666620 Dec 11 '15 at 10:53
-
My client has told me to do.. – Anuraj Sharma Dec 11 '15 at 11:10
-
@AnurajSharma you can point this point out to the client. It is important they understand the implications of their requirements. Perhaps propose to keep the logs for two weeks or 1 month before they're deleted. – Alex Dec 11 '15 at 11:12
-
Yes I will suggest them..but is there any way to delete logs while using log4net after a month – Anuraj Sharma Dec 11 '15 at 11:22
1 Answers
0
You absolutely can create logs weekly. See how you do it on daily basis in this question. Here is a possible solution, however it's been 5 years since it was proposed.
Removing can be done with a PowerShell script + Windows job, by service or other means. See this question for possible solutions.