play
Class Logger

java.lang.Object
  extended by play.Logger

public class Logger
extends java.lang.Object

Main logger of the application. Free to use from the aplication code.


Nested Class Summary
static class Logger.JuliToLog4jHandler
          juli handler that Redirect to log4j
 
Field Summary
static boolean forceJuli
          Will force use of java.util.logging (default to try log4j first).
static java.util.logging.Logger juli
          When using java.util.logging.
static org.apache.log4j.Logger log4j
          The application logger (play).
static boolean recordCaller
          Will record and display the caller method.
static boolean redirectJuli
          Will redirect all log from java.util.logging to log4j.
 
Constructor Summary
Logger()
           
 
Method Summary
static void debug(java.lang.String message, java.lang.Object... args)
          Log with DEBUG level
static void debug(java.lang.Throwable e, java.lang.String message, java.lang.Object... args)
          Log with DEBUG level
static void error(java.lang.String message, java.lang.Object... args)
          Log with ERROR level
static void error(java.lang.Throwable e, java.lang.String message, java.lang.Object... args)
          Log with ERROR level
static void fatal(java.lang.String message, java.lang.Object... args)
          Log with FATAL level
static void fatal(java.lang.Throwable e, java.lang.String message, java.lang.Object... args)
          Log with FATAL level
static void info(java.lang.String message, java.lang.Object... args)
          Log with INFO level
static void info(java.lang.Throwable e, java.lang.String message, java.lang.Object... args)
          Log with INFO level
static void init()
          Try to init stuff.
static void setUp(java.lang.String level)
          Force logger to a new level.
static void trace(java.lang.String message, java.lang.Object... args)
          Log with TRACE level
static void warn(java.lang.String message, java.lang.Object... args)
          Log with WARN level
static void warn(java.lang.Throwable e, java.lang.String message, java.lang.Object... args)
          Log with WARN level
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

forceJuli

public static boolean forceJuli
Will force use of java.util.logging (default to try log4j first).


redirectJuli

public static boolean redirectJuli
Will redirect all log from java.util.logging to log4j.


recordCaller

public static boolean recordCaller
Will record and display the caller method.


log4j

public static org.apache.log4j.Logger log4j
The application logger (play).


juli

public static java.util.logging.Logger juli
When using java.util.logging.

Constructor Detail

Logger

public Logger()
Method Detail

init

public static void init()
Try to init stuff.


setUp

public static void setUp(java.lang.String level)
Force logger to a new level.

Parameters:
level - TRACE,DEBUG,INFO,WARN,ERROR,FATAL

trace

public static void trace(java.lang.String message,
                         java.lang.Object... args)
Log with TRACE level

Parameters:
message - The message pattern
args - Pattern arguments

debug

public static void debug(java.lang.String message,
                         java.lang.Object... args)
Log with DEBUG level

Parameters:
message - The message pattern
args - Pattern arguments

debug

public static void debug(java.lang.Throwable e,
                         java.lang.String message,
                         java.lang.Object... args)
Log with DEBUG level

Parameters:
e - the exception to log
message - The message pattern
args - Pattern arguments

info

public static void info(java.lang.String message,
                        java.lang.Object... args)
Log with INFO level

Parameters:
message - The message pattern
args - Pattern arguments

info

public static void info(java.lang.Throwable e,
                        java.lang.String message,
                        java.lang.Object... args)
Log with INFO level

Parameters:
e - the exception to log
message - The message pattern
args - Pattern arguments

warn

public static void warn(java.lang.String message,
                        java.lang.Object... args)
Log with WARN level

Parameters:
message - The message pattern
args - Pattern arguments

warn

public static void warn(java.lang.Throwable e,
                        java.lang.String message,
                        java.lang.Object... args)
Log with WARN level

Parameters:
e - the exception to log
message - The message pattern
args - Pattern arguments

error

public static void error(java.lang.String message,
                         java.lang.Object... args)
Log with ERROR level

Parameters:
message - The message pattern
args - Pattern arguments

error

public static void error(java.lang.Throwable e,
                         java.lang.String message,
                         java.lang.Object... args)
Log with ERROR level

Parameters:
e - the exception to log
message - The message pattern
args - Pattern arguments

fatal

public static void fatal(java.lang.String message,
                         java.lang.Object... args)
Log with FATAL level

Parameters:
message - The message pattern
args - Pattern arguments

fatal

public static void fatal(java.lang.Throwable e,
                         java.lang.String message,
                         java.lang.Object... args)
Log with FATAL level

Parameters:
e - the exception to log
message - The message pattern
args - Pattern arguments


Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly