Hi there,

         I have a function writeLogMsg(priority,msg), which uses a
WriterAppender to write the msg. to a file. My problem is if I call this fn.
say 4 times with different priority and message, the fourth one will be
prining 4 times. I miss the output of first 3 fn. calls.here is the code.
Any kind of suggestions are appreciated.
thanx,
mathew.
 
public void writeLogFile(Priority P, String logMsg)  {

try{
    File f = new File("c:\\logfile.log"); // getLogFile();    
   FileOutputStream out= new FileOutputStream(f);    
    Category root = Category.getRoot();
    Layout layout = new PatternLayout("%r %d [%t]%-5p %c %x - %m%n");
    root.addAppender(new WriterAppender(layout,out));
    cat.log(P,logMsg);

    } catch(Exception e) {

       System.out.println(" Exception is caught in writeLogFile method");
          }
        }
 

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

Reply via email to