play

## Class Logger

- java.lang.Object
- - play.Logger

    public class Logger
    extends java.lang.Object

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

### Nested Class Summary

Nested Classes
`static class` `Logger.JuliToLog4jHandler` juli handler that Redirect to log4j

### Field Summary

Fields
`static boolean` `configuredManually` true if logger is configured manually (log4j-config file supplied by application)
`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

Constructors
Constructor and Description
`Logger()`

### Method Summary

All Methods Static Methods Concrete Methods
`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 boolean` `isDebugEnabled()`
`static boolean` `isEnabledFor(org.apache.log4j.Level log4jLevel)`
`static boolean` `isEnabledFor(java.lang.String level)`
`static boolean` `isTraceEnabled()`
`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 boolean` `usesJuli()`
`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.

#### configuredManually

    public static boolean configuredManually

true if logger is configured manually (log4j-config file supplied by application)

### Constructor Detail

#### Logger

    public Logger()

### Method Detail

#### usesJuli

    public static boolean usesJuli()

#### 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

#### isDebugEnabled

    public static boolean isDebugEnabled()

Returns:
  true if log4j.debug / jul.fine logging is enabled

#### isTraceEnabled

    public static boolean isTraceEnabled()

Returns:
  true if log4j.trace / jul.finest logging is enabled

#### isEnabledFor

    public static boolean isEnabledFor(java.lang.String level)

Parameters:
  `level` - string representation of Logging-levels as used in log4j
Returns:
  true if specified logging-level is enabled

#### isEnabledFor

    public static boolean isEnabledFor(org.apache.log4j.Level log4jLevel)

Parameters:
  `log4jLevel` - Logging-levels as used in log4j
Returns:
  true if specified logging-level is enabled

#### 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