473,325 Members | 2,870 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

log4net clear log file

Hi there,
I am using log4net in my (.net v1.1) application to log the messages. I
tried to clear the logfile while application is running. since log4net has
the file handle it did not allow me to clear/delete the file. I need to clear
the content of the log file specified in the log4net configuration file, when
it is needed in the application(such as some button click event), If anybody
familiar with log4net your help would be appriciated...

--Dhans
Apr 7 '06 #1
4 10517
Hello Dhans,

I don't use log4net for several month, but there was a option of log4net
config's file where you can specify what to do with log - override or append.
Look through doc carefully

D> Hi there,
D> I am using log4net in my (.net v1.1) application to log the messages.
D> I
D> tried to clear the logfile while application is running. since
D> log4net has
D> the file handle it did not allow me to clear/delete the file. I need
D> to clear
D> the content of the log file specified in the log4net configuration
D> file, when
D> it is needed in the application(such as some button click event), If
D> anybody
D> familiar with log4net your help would be appriciated...
D> --Dhans
D>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Apr 8 '06 #2
Hi Michael,
Thanks for your response. In my config I have selected append option. It is
not related to config file. I need to clear the content of the log file when
ever i need to do from the application while it is running.

Is there any newsgroup for log4net or where i can get help on that?

--Dhans

"Michael Nemtsev" wrote:
Hello Dhans,

I don't use log4net for several month, but there was a option of log4net
config's file where you can specify what to do with log - override or append.
Look through doc carefully


Apr 9 '06 #3
In article <C1**********************************@microsoft.co m>, Dhans
wrote:
I need to clear the content of the log file when
ever i need to do from the application while it is running.


You could try using the RollingFileAppender which can switch to a
different file based on date/time or log file size.

That allows you to at least delete older logs.

Mike

Apr 10 '06 #4
Thanks Michael...

"Mike Blake-Knox" wrote:
You could try using the RollingFileAppender which can switch to a
different file based on date/time or log file size.

Apr 10 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: SK | last post by:
Hi, I am using log4net in my c# application.Want to know how to customize the log output format. I know that it can be done using LayoutSkeleton class,but dont know what other parameters to be...
0
by: anonieko | last post by:
Add a reference to log4net.dll 1: In the APP.CONFIG write the following: <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <section name="log4net"...
4
by: Gawel | last post by:
hajo, can someone send me an example how to use above pattern in asp.net applicaiton? I can not figure out how to do it. I get no exceptions, simply no logging occures. Thanks for any info ...
2
by: Vikram | last post by:
I am using log4net in a vb.net console application. But its not working. I have added congif setting in app.config file also No error is generated but app. does not write to log file. ...
6
by: Mr Flibble | last post by:
Hi all, I've decided to use log4net for my logging/tracing. In the example on the site it shows using main() to setup the root logger and then using the LogManager within your classes to...
2
by: Marc Scheuner | last post by:
Folks, I'd really like to use log4net for our error logging, but I'm having two problems: 1) For certain cases, I'd like to log error and messages to text files. I tried both the regular...
1
by: chidam.chidam | last post by:
Hi all, I would like to implement log4net for logging my application. First let me describe in short about the application. I have a solution with two exe file outputs and several dll assemblies....
2
by: forest demon | last post by:
I need to be able to create an appender to direct output to a MessageBox. The API does not have a MessageBox appender like nLog does. What would be the easiest way to do this. The examples...
0
by: rosshinkley | last post by:
Greetings. I know that log4net supports filtering based on properties (log4net.Filter.PropertyFilter). Trouble is, I'm having trouble spotting what valid property names are. Are they intrinsic...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.