In a few words, what I want to do is to clear the file during the
execution. I can´t use another file for the appender because it has to be
the same file but cleared.


-----Mensaje original-----
De: Sam Newman [mailto:[EMAIL PROTECTED]]
Enviado el: jueves, 19 de julio de 2001 11:38
Para: LOG4J Users Mailing List
Asunto: Re: Problems to clear the log file at runtime


I'm not 100% sure what it is you want.... If you want to move the file
before you start logging (e.g. you want to backup an old log before logging
new information) then simply move the file before you configure logging. If
you want to clear the file during the execution of the program, then
couldn't you simply reconfigure the logging to use a new file for your
appender?

sam
----- Original Message -----
From: "David Muelas Sánchez" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 19, 2001 9:27 AM
Subject: Problems to clear the log file at runtime


>
> Hi all,
>
> I´m using Log4j in an java application that generates a log file in the
> server. I´m configuring Log4j with the propertyConfigurator (my
> configuration is in a file). The problem is that I need to copy the log´s
> information to another file and clear the log file at runtime. Well, I can
> clear the file with the RandomAccessFile class but when I post a new
message
> in the log, Log4j doesn´t append it at the beginnig of the log file. The
> result is a file with a lot of spaces (so much as bytes has been cleared
> from the file) and, at the end of the file the new message.
>
> I need to do this but I don´t know how to do it. Thanks a lot for your
help
> ...
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to