API Overview API Index Package Overview Direct link to this page
JavaOnTracks 0.1.2
  net.jot.logger. JOTLogger View Source
Author(s)
thibautc
Since
Version
Serial
Hierarchy
 Object
      JOTLogger
Implements
Subclasses
Description
publicfinal class JOTLogger
  Thi is a simple implementation of a logging system.
See also:   
Constructors
public JOTLogger ()
Methods
Hide/Show inherited methods
publicstatic void critical (Object o, String message)
  Logs a message with the CRITICAL level
publicstatic void critical (Object o, String user, String message)
  Logs a message with the CRITICAL level
publicstatic void critical (String cat, Object o, String message)
  Logs a message with the CRITICAL level
publicstatic void critical (String cat, Object o, String user, String message)
  Logs a message with the CRITICAL level
publicstatic void debug (Object o, String message)
  Logs a message with the DEBUG level
publicstatic void debug (Object o, String user, String message)
  Logs a message with the DEBUG level
publicstatic void debug (String cat, Object o, String message)
  Logs a message with the DEBUG level
publicstatic void debug (String cat, Object o, String user, String message)
  Logs a message with the DEBUG level
publicstatic void destroy ()
Cleanup resources on exit.
publicstatic void error (Object o, String message)
  Logs a message with the ERROR level
publicstatic void error (Object o, String user, String message)
  Logs a message with the ERROR level
publicstatic void error (String cat, Object o, String message)
  Logs a message with the ERROR level
publicstatic void error (String cat, Object o, String user, String message)
  Logs a message with the ERROR level
publicstatic Vector getLastLogEntries (Vector levels, int max) throws Throwable
  "Tail" the log file to get the latest entries
publicstatic void info (Object o, String message)
  Logs a message with the INFO level
publicstatic void info (Object o, String user, String message)
  Logs a message with the INFO level
publicstatic void info (String cat, Object o, String message)
  Logs a message with the INFO level
publicstatic void info (String cat, Object o, String user, String message)
  Logs a message with the INFO level
publicstaticsynchronized void init (JOTPreferenceInterface prefs, String logFile)
  Initializes the logger
publicstaticsynchronized void init (JOTPreferenceInterface prefs, String folder, String logFile)
  Initializes the logger manually
publicstaticsynchronized void init (String fileName, String levels, String categories)
  Manually init the logger
publicstatic void initIfNecessary (String filePath, String levels, String categories)
  Will init only if not inited already
publicstatic boolean isCriticalEnabled ()
publicstatic boolean isDebugEnabled ()
publicstatic boolean isErrorEnabled ()
publicstatic boolean isInfoEnabled ()
publicstatic boolean isTraceEnabled ()
publicstatic boolean isWarningEnabled ()
publicstatic void log (int level, Object o, String message)
  Log a message
publicstatic void log (int level, Object o, String user, String message)
  Log a message
publicstatic void log (String cat, int level, Object o, String message)
  Log a message
publicstatic void log (String cat, int level, Object o, String user, String message)
  Log a message
publicstatic void log (String cat, int level, String servletName, String user, String message)
  Log a message
publicstatic void logException (int level, Object o, String message, Throwable e)
  Log an exception
publicstatic void logException (Object o, String message, Throwable e)
  log the exception & trace with level: ERROR and default Category
publicstatic void logException (String category, int level, Object o, String message, Throwable e)
  Log an exception (with the whole stack)
publicstatic void logException (String category, int level, String servletName, String user, String message, Throwable e)
  Log an exception (with the whole stack)
publicstatic void logException (String category, Object o, String message, Throwable e)
  log the exception & trace with level: ERROR
publicstatic void setCategories (String cat)
  Set the categories to enable(null means all).
publicstatic void setDefaultCategory (String cat)
  Sets the default logging category (ie: "Myapp")
publicstatic void setLevels (String levelString)
  Sets the log level to be enabled (other levels won't be logged) levels can be like this: [0,1,2] 0, 1 and 2 0 is Trace, 5 is Critical
publicstatic void setPrintStackTrace (boolean printStackTrace)
  Wether to dump the exception stacktrace when logException is used
publicstatic void setPrintToConcole (boolean printToConsole)
  Wether to dump all errors to the console as well as the log file.
publicstatic void trace (Object o, String message)
  Logs a message with the TRACE level
publicstatic void trace (Object o, String user, String message)
  Logs a message with the TRACE level
publicstatic void trace (String cat, Object o, String message)
  Logs a message with the TRACE level
publicstatic void trace (String cat, Object o, String user, String message)
  Logs a message with the TRACE level
publicstatic void warning (Object o, String message)
  Logs a message with the WARNING level
publicstatic void warning (Object o, String user, String message)
  Logs a message with the WARNING level
publicstatic void warning (String cat, Object o, String message)
  Logs a message with the WARNING level
publicstatic void warning (String cat, Object o, String user, String message)
  Logs a message with the WARNING level
Fields
Hide/Show inherited fields
publicstatic String ALL_LEVELS
publicfinalstatic String CAT_DB = "JOT.DB"
publicfinalstatic String CAT_FLOW = "JOT.FLOW"
publicfinalstatic String CAT_MAIN = "JOT"
publicfinalstatic String CAT_SERVER = "JOT.SERVER"
publicfinalstatic int CRITICAL_LEVEL = "5"
publicfinalstatic int DEBUG_LEVEL = "1"
publicfinalstatic int ERROR_LEVEL = "4"
publicfinalstatic int INFO_LEVEL = "2"
publicfinalstatic int TRACE_LEVEL = "0"
publicfinalstatic int WARNING_LEVEL = "3"
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.5     ©Thibaut Colar