can anyone help me about rotation Logging issue



My task is : Archieving log file before logging rotation (define
logfile size ,number)
only can copy file but append file.

or someone told how to append log file by using FileHandler or other
class,

Thanks a lot


*******************************
for (int i = 0; i < fileNumber; i++) {
String pathName=dirName + fileNamePrefix +i+"."+fileNameSuff;
String currentLog=dirName + fileNamePrefix + i + "."+ fileNameSuff;
File currentLogFile = new File(pathName);
long alen=currentLogFile.length();


if (currentLogFile.length() >= fileSize) {

UtilFile.copyfile(dirName + fileNamePrefix + i + "."+ fileNameSuff,
dirName + "trace_" +fileNamePrefix+ i + "." + fileNameSuff);
(UtilFile.removeFile(dirName + fileNamePrefix + i + "."+ fileNameSuff))
{;
file = new FileHandler(dirName + fileNamePrefix + "%g."+ fileNameSuff,
fileSize, fileNumber, append);
elLogger.addHandler(file);
elLogger.info("info message");
}
} else {
//UtilFile.writeFileAppend(currDate+objName+elLevel,currentLog);

file = new FileHandler(dirName + fileNamePrefix+ "%g." + fileNameSuff,
fileSize,fileNumber, append);
elLogger.addHandler(file);
elLogger.info("info message");
}
}

*********************
.



Relevant Pages

  • Re: Seek() wont compile???
    ... >> I've defined LogFile as type TextFile, ... >> FileSize to that, and using the variable, and it still won't compile. ... > to a text file in which case you can simply use append(). ...
    (borland.public.delphi.language.objectpascal)
  • Re: writing to a log reliably
    ... There's no difference in the code below for Replace and Append! ... But how do I write to a log file reliably? ... logline2 = timelogline ... Call Stream log_name, 'C', 'OPEN WRITE REPLACE' ...
    (comp.lang.rexx)
  • Re: [fw-wiz] More Syslog Questions
    ... > The only problem I have with chattr +a is that if an intruder gains ... > and the replace the append only attribute, ... > done to the log file. ...
    (Firewall-Wizards)
  • Re: Trimming the appended FileStream
    ... Just open a file in OpenOrCreate mode and then use FileStream.Seekto append new text to the end of log file. ... {private const string LOGGER = "LOGGER> "; ... if (consoleOutput) Console.WriteLine; ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Can not format to FAT32???
    ... - interactive DOS Scandisk; save log, always Append ... - your log file is C:\Scandisk.log ... - no ChkDsk interactive mode exists ...
    (microsoft.public.windowsxp.general)