Package javaforce

Class JFLog

java.lang.Object
javaforce.JFLog

public class JFLog extends Object
JFLog is a file logger with support for multiple files and optional outputs to System.out as well.
  • Field Details

  • Constructor Details

    • JFLog

      public JFLog()
  • Method Details

    • init

      public static boolean init(int id, String filename, boolean append, PrintStream stdout)
    • init

      public static boolean init(String filename, boolean stdout)
    • init

      public static boolean init(int id, String filename, boolean stdout)
    • append

      public static boolean append(String filename, boolean stdout)
    • append

      public static boolean append(int id, String filename, boolean stdout)
    • getIDs

      public static int[] getIDs()
    • getLogFileName

      public static String getLogFileName(int id)
    • setRetention

      public static void setRetention(int id, int days)
    • setRetention

      public static void setRetention(int days)
    • setMaxFilesize

      public static void setMaxFilesize(int id, long size)
      Sets max file size for log. Once the file is greater the log will rotate()
    • setMaxFilesize

      public static void setMaxFilesize(long size)
      Sets max file size for log. Once the file is greater the log will rotate()
    • close

      public static boolean close(int id)
    • close

      public static boolean close()
    • enableTimestamp

      public static void enableTimestamp(boolean state)
      Uses a timestamp instead of date/time for each message logged. Timestamp is based on time when this method is called. Effects all logs.
    • setShowCause

      public static void setShowCause(boolean state)
      Display cause of Exceptions in log(Throwable t).
    • log

      public static boolean log(String msg)
    • log

      public static boolean log(int id, String msg)
    • log

      public static boolean log(String msg, byte[] buffer, int offset, int length)
    • log

      public static boolean log(int id, String msg, byte[] buffer, int offset, int length)
    • rotate

      public static boolean rotate(int id)
      Rotates log file.
    • getFiles

      public static File[] getFiles(int id)
    • rotate

      public static boolean rotate()
      Rotates log file.
    • log

      public static boolean log(Throwable t)
    • log

      public static boolean log(int id, Throwable t)
    • log

      public static boolean log(String msg, Throwable t)
    • log

      public static boolean log(int id, String msg, Throwable t)
    • setEnabled

      public static void setEnabled(int id, boolean state)
    • setEnabled

      public static void setEnabled(boolean state)
    • write

      public static boolean write(int id, byte[] data, int off, int len)
      NOTE: write() doesn't cycle log files.
    • write

      public static boolean write(byte[] data, int off, int len)
      NOTE: write() doesn't cycle log files.
    • getOutputStream

      public static OutputStream getOutputStream(int id)
    • getOutputStream

      public static OutputStream getOutputStream()
    • logTrace

      public static void logTrace(int id, String msg)
    • logTrace

      public static void logTrace(String msg)