Package javaforce
Class JFLog
java.lang.Object
javaforce.JFLog
JFLog is a file logger with support for multiple files and optional outputs
to System.out as well.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanstatic booleanstatic booleanclose()static booleanclose(int id) static voidenableTimestamp(boolean state) Uses a timestamp instead of date/time for each message logged.static OutputStreamstatic OutputStreamgetOutputStream(int id) static booleanstatic booleaninit(int id, String filename, boolean append, PrintStream stdout) static booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic booleanstatic voidstatic voidstatic booleanrotate()Rotates log file.static booleanrotate(int id) Rotates log file.static voidsetEnabled(boolean state) static voidsetEnabled(int id, boolean state) static voidsetMaxFilesize(int id, long size) Sets max file size for log.static voidsetMaxFilesize(long size) Sets max file size for log.static voidsetRetention(int days) static voidsetRetention(int id, int days) static voidsetShowCause(boolean state) Display cause of Exceptions in log(Throwable t).static booleanwrite(byte[] data, int off, int len) NOTE: write() doesn't cycle log files.static booleanwrite(int id, byte[] data, int off, int len) NOTE: write() doesn't cycle log files.
-
Field Details
-
DEFAULT
public static final int DEFAULT- See Also:
-
TRACE
public static final int TRACE- See Also:
-
DEBUG
public static final int DEBUG- See Also:
-
INFO
public static final int INFO- See Also:
-
WARN
public static final int WARN- See Also:
-
ERROR
public static final int ERROR- See Also:
-
-
Constructor Details
-
JFLog
public JFLog()
-
-
Method Details
-
init
-
init
-
init
-
append
-
append
-
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
-
log
-
rotate
public static boolean rotate(int id) Rotates log file. -
rotate
public static boolean rotate()Rotates log file. -
log
-
log
-
log
-
log
-
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
-
getOutputStream
-
logTrace
-
logTrace
-