I am working with log4net.
I wants to add a button in my GUI that when the user click on that button,
the log file will cleared.
How can I do that?
Thanks alot
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It is not supported “out of the box” from log4net. However, you could using the RollingFileAppender and create a manual class/method to clean up/delete the log file.
For reference, Log4Net: set Max backup files on RollingFileAppender with rolling Date
Another approach to avoid the file being locked would be to set the minimal locking level on the log file via: