Class CLogFile

java.lang.Object
java.util.logging.Handler
org.compiere.util.CLogFile

public class CLogFile extends Handler
Handler that publish log record to server log file
Version:
$Id: CLogFile.java,v 1.3 2006/07/30 00:54:35 jjanke Exp $
Author:
Jorg Janke
  • Constructor Details

    • CLogFile

      public CLogFile(String idempiereHome, boolean createLogDir, boolean isClient)
      Constructor
      Parameters:
      idempiereHome - idempiere home
      createLogDir - create log directory if missing
      isClient - client
  • Method Details

    • getFileNameDate

      public static String getFileNameDate(long time)
      Get File Name Date portion
      Parameters:
      time - time in ms
      Returns:
      Date String
    • getFileNameDateTime

      public static String getFileNameDateTime(long time)
      Get File Name DateTime portion
      Parameters:
      time - time in ms
      Returns:
      DateTime String on Seconds
    • rotateLog

      public void rotateLog()
      Rotate Log file.
      Called after Initialization.
    • reopen

      public void reopen()
      Re-use previous log file (if available).
    • getFileName

      public String getFileName()
      Get File Name
      Returns:
      file name
    • getLogDirectory

      public File getLogDirectory()
      Get Log Directory
      Returns:
      log directory or null
    • setLevel

      public void setLevel(Level newLevel) throws SecurityException
      Set Level
      Overrides:
      setLevel in class Handler
      Parameters:
      newLevel - new Level
      Throws:
      SecurityException
      See Also:
    • publish

      public void publish(LogRecord record)
      Publish log record
      Specified by:
      publish in class Handler
      Parameters:
      record - log record
      See Also:
    • flush

      public void flush()
      Flush output
      Specified by:
      flush in class Handler
      See Also:
    • close

      public void close() throws SecurityException
      Close log file
      Specified by:
      close in class Handler
      Throws:
      SecurityException
      See Also:
    • toString

      public String toString()
      String Representation
      Overrides:
      toString in class Object
      Returns:
      info
    • get

      public static CLogFile get(boolean create, String idempiereHome, boolean isClient)
      Get or create CLogFile handler.
      Parameters:
      create -
      idempiereHome -
      isClient -
      Returns:
      CLogFile handler