Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.slide.util.logger
Interface Logger

All Known Implementing Classes:
  SimpleLogger

public interface Logger

The `Logger` block interface.

This interface must be implemented by those blocks willing to log data coming from other blocks.

The six levels used for logging are (in order of gravity): EMERGENCY, CRITICAL, ERROR, WARNING, INFO and DEBUG.

Version:
  1.0 (CVS $Revision: 1.9 $ $Date: 2004/07/28 09:34:23 $)

Field Summary
`static int` | `CRITICAL` The CRITICAL logging level (anything logged under this level means that a critical temporary error was detected).
`static int` | `DEBUG` The DEBUG logging level (anything logged under this level means that an debug message must be logged).
`static java.lang.String` | `DEFAULT_CHANNEL` Specify the default string for logging without a channel.
`static int` | `EMERGENCY` The EMERGENCY logging level (anything logged under this level means that a critical permanent error was detected).
`static int` | `ERROR` The ERROR logging level (anything logged under this level means that a non-critical error was detected).
`static int` | `INFO` The INFO logging level (anything logged under this level means that an informative message must be logged).
`static int` | `WARNING` The WARNING logging level (anything logged under this level means that a generic error was detected).

Method Summary
`int` | `getLoggerLevel()` Get the logger level for the default channel
`int` | `getLoggerLevel(java.lang.String channel)` Get the logger level for the specified channel
`boolean` | `isEnabled(int level)` Check if the default channel with the specified level is enabled for logging.
`boolean` | `isEnabled(java.lang.String channel, int level)` Check if the channel with the specified level is enabled for logging.
`void` | `log(java.lang.Object data)` Log an object.
`void` | `log(java.lang.Object data, int level)` Log an object with the specified level.
`void` | `log(java.lang.Object data, java.lang.String channel, int level)` Log an object thru the specified channel and with the specified level.
`void` | `log(java.lang.Object data, java.lang.Throwable throwable, java.lang.String channel, int level)` Log an object and an associated throwable thru the specified channel and with the specified level.
`void` | `setLoggerLevel(int level)` Set the logger level for the default channel
`void` | `setLoggerLevel(java.lang.String channel, int level)` Set the logger level for the specified channel

Field Detail

### EMERGENCY

    public static final int EMERGENCY

  The EMERGENCY logging level (anything logged under this level means that a critical permanent error was detected).

  When a `Block` logs something with this level means that any other task will be impossible without administrator's intervention.

  Example:
  - AJP handler cannot find the secret key file. Cannot process servlet requests.
  - Cannot access to mail server database URL jdbc:mysql://localhost/users (SQLException caught in driver initialization)

  See Also:
    Constant Field Values

### CRITICAL

    public static final int CRITICAL

  The CRITICAL logging level (anything logged under this level means that a critical temporary error was detected).

  When a `Block` logs something with this level means that tasks similar to the one generating the error will be impossible without administrator's intervention, but other tasks (maybe using different resources) will be possible.

  Example:
  - Cannot serve servlet in zone "myServletZone" (repository not found)
  - Cannot alias address "listserv@apache.org" to ListServlet (mail servlet not found)

  See Also:
    Constant Field Values

### ERROR

    public static final int ERROR

  The ERROR logging level (anything logged under this level means that a non-critical error was detected).

  When a `Block` logs something with this level means that the current tasks failed to execute, but the stability of the block is not compromised.

  Example:
  - Cannot serve servlet "SnoopServlet" to client 192.168.1.1 due to security restriction
  - User "ianosh" denied access via POP3 protocol due to invalid password

  See Also:
    Constant Field Values

### WARNING

    public static final int WARNING

  The WARNING logging level (anything logged under this level means that a generic error was detected).

  When a `Block` logs something with this level means that the current tasks failed to execute due to inconsistencies in the request handled by the block.

  Example:
  - Cannot find servlet "SnoopServlet" requested by 192.168.1.1 via AJP protocol
  - Cannot deliver mail from "root@localhost" to "ianosh@iname.com" via protocol SMTP (user not found)

  See Also:
    Constant Field Values

### INFO

    public static final int INFO

  The INFO logging level (anything logged under this level means that an informative message must be logged).

  When a `Block` logs something with this level means that something that may be interesting happened.

  Example:
  - Successfully handled request from 192.168.1.1 via AJP protocol for "SnoopServlet" servlet
  - Mail from "root@localhost" delivered successfully to "ianosh@iname.com" via protocol SMTP

  See Also:
    Constant Field Values

### DEBUG

    public static final int DEBUG

  The DEBUG logging level (anything logged under this level means that an debug message must be logged).

  When a `Block` logs something with this level means that something that may be interesting while developing, tracking bugs or misconfigurations.

  Example:
  - Requested servlet "snoop" was aliased to "org.apache.servlets.SnoopServlet"
  - MX record for domain "dom.tld" resolved to host "mail.dom.tld" (192.168.1.1) with preference level 10

  See Also:
    Constant Field Values

### DEFAULT_CHANNEL

    public static final java.lang.String DEFAULT_CHANNEL

  Specify the default string for logging without a channel.

  See Also:
    Constant Field Values

Method Detail

### log

    public void log(java.lang.Object data,
                    java.lang.Throwable throwable,
                    java.lang.String channel,
                    int level)

  Log an object and an associated throwable thru the specified channel and with the specified level.

  Parameters:
    `data` - object to log
    `throwable` - throwable to be logged
    `channel` - channel name used for logging
    `level` - level used for logging

### log

    public void log(java.lang.Object data,
                    java.lang.String channel,
                    int level)

  Log an object thru the specified channel and with the specified level.

  Parameters:
    `data` - The object to log.
    `channel` - The channel name used for logging.
    `level` - The level used for logging.

### log

    public void log(java.lang.Object data,
                    int level)

  Log an object with the specified level.

  Parameters:
    `data` - The object to log.
    `level` - The level used for logging.

### log

    public void log(java.lang.Object data)

  Log an object.

  Parameters:
    `data` - The object to log.

### setLoggerLevel

    public void setLoggerLevel(int level)

  Set the logger level for the default channel

  Parameters:
    `level` - The new log level

### setLoggerLevel

    public void setLoggerLevel(java.lang.String channel,
                               int level)

  Set the logger level for the specified channel

  Parameters:
    `channel` - The channel for which the level is set.
    `level` - The new log level

### getLoggerLevel

    public int getLoggerLevel()

  Get the logger level for the default channel

### getLoggerLevel

    public int getLoggerLevel(java.lang.String channel)

  Get the logger level for the specified channel

  Parameters:
    `channel` - The channel whose log level is returned.

### isEnabled

    public boolean isEnabled(java.lang.String channel,
                             int level)

  Check if the channel with the specified level is enabled for logging.

  Parameters:
    `channel` - The channel specification
    `level` - The level specification

### isEnabled

    public boolean isEnabled(int level)

  Check if the default channel with the specified level is enabled for logging.

  Parameters:
    `level` - The level specification

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD