org.apache.mina.filter.logging

## Class LoggingFilter

- java.lang.Object
- - org.apache.mina.filter.logging.LoggingFilter

All Implemented Interfaces:
  IoFilter

    public class LoggingFilter
    extends Object
    implements IoFilter

A simple filter logging incoming events.

Author:
  jvermillar

### Constructor Summary

Constructors
Constructor and Description
`LoggingFilter()` Default Constructor.
`LoggingFilter(Class<?> clazz)` Create a new LoggingFilter using a class name
`LoggingFilter(String name)` Create a new LoggingFilter using a name

### Method Summary

Methods
`LogLevel` `getMessageReceivedLogLevel()` Get the LogLevel for the MessageReceived event.
`LogLevel` `getMessageSentLevel()` Get the LogLevel for the messageSent event.
`LogLevel` `getMessageWritingLogLevel()` Get the LogLevel for the MessageWriting event.
`LogLevel` `getSessionClosedLogLevel()` Get the LogLevel for the SessionClosed event.
`LogLevel` `getSessionIdleLogLevel()` Get the LogLevel for the SessionIdle event.
`LogLevel` `getSessionOpenedLogLevel()` Get the LogLevel for the SessionOpened event.
`void` `messageReceived(IoSession session, Object message, ReadFilterChainController controller)` Invoked when a message is received.
`void` `messageSent(IoSession session, Object message)` Invoked when a high level message was written to the low level O/S buffer.
`void` `messageWriting(IoSession session, WriteRequest message, WriteFilterChainController controller)` Invoked when a message is under writing.
`void` `sessionClosed(IoSession session)` Invoked when a connection is closed.
`void` `sessionIdle(IoSession session, IdleStatus status)` Invoked with the related `IdleStatus` when a connection becomes idle.
`void` `sessionOpened(IoSession session)` Invoked when a connection has been opened.
`void` `setMessageReceivedLogLevel(LogLevel level)` Set the LogLevel for the MessageReceived event.
`void` `setMessageSentLevel(LogLevel messageSentLevel)` Set the LogLevel for the messageSent event.
`void` `setMessageWritingLogLevel(LogLevel level)` Set the LogLevel for the MessageWriting event.
`void` `setSessionClosedLogLevel(LogLevel level)` Set the LogLevel for the SessionClosed event.
`void` `setSessionIdleLogLevel(LogLevel level)` Set the LogLevel for the SessionIdle event.
`void` `setSessionOpenedLogLevel(LogLevel level)` Set the LogLevel for the SessionOpened event.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### LoggingFilter

    public LoggingFilter()

Default Constructor.

#### LoggingFilter

    public LoggingFilter(Class<?> clazz)

Create a new LoggingFilter using a class name

Parameters:
  `clazz` - the class which name will be used to create the logger

#### LoggingFilter

    public LoggingFilter(String name)

Create a new LoggingFilter using a name

Parameters:
  `name` - the name used to create the logger. If null, will default to "LoggingFilter"

### Method Detail

#### sessionOpened

    public void sessionOpened(IoSession session)

Invoked when a connection has been opened.

Specified by:
  `sessionOpened` in interface `IoFilter`
Parameters:
  `session` - `IoSession` associated with the invocation

#### sessionClosed

    public void sessionClosed(IoSession session)

Invoked when a connection is closed.

Specified by:
  `sessionClosed` in interface `IoFilter`
Parameters:
  `session` - `IoSession` associated with the invocation

#### sessionIdle

    public void sessionIdle(IoSession session,
                   IdleStatus status)

Invoked with the related `IdleStatus` when a connection becomes idle.

Specified by:
  `sessionIdle` in interface `IoFilter`
Parameters:
  `session` - `IoSession` associated with the invocation

#### messageSent

    public void messageSent(IoSession session,
                   Object message)

Invoked when a high level message was written to the low level O/S buffer.

Specified by:
  `messageSent` in interface `IoFilter`
Parameters:
  `session` - `IoSession` associated with the invocation
  `message` - the incoming message to process

#### messageReceived

    public void messageReceived(IoSession session,
                       Object message,
                       ReadFilterChainController controller)

Invoked when a message is received.

Specified by:
  `messageReceived` in interface `IoFilter`
Parameters:
  `session` - `IoSession` associated with the invocation
  `message` - the incoming message to process

#### messageWriting

    public void messageWriting(IoSession session,
                      WriteRequest message,
                      WriteFilterChainController controller)

Invoked when a message is under writing. The filter is supposed to apply the needed transformation.

Specified by:
  `messageWriting` in interface `IoFilter`
Parameters:
  `session` - `IoSession` associated with the invocation
  `message` - the message to process before writing

#### setMessageReceivedLogLevel

    public void setMessageReceivedLogLevel(LogLevel level)

Set the LogLevel for the MessageReceived event.

Parameters:
  `level` - The LogLevel to set

#### getMessageReceivedLogLevel

    public LogLevel getMessageReceivedLogLevel()

Get the LogLevel for the MessageReceived event.

Returns:
  The LogLevel for the MessageReceived eventType

#### setMessageWritingLogLevel

    public void setMessageWritingLogLevel(LogLevel level)

Set the LogLevel for the MessageWriting event.

Parameters:
  `level` - The LogLevel to set

#### getMessageWritingLogLevel

    public LogLevel getMessageWritingLogLevel()

Get the LogLevel for the MessageWriting event.

Returns:
  The LogLevel for the MessageWriting eventType

#### setSessionOpenedLogLevel

    public void setSessionOpenedLogLevel(LogLevel level)

Set the LogLevel for the SessionOpened event.

Parameters:
  `level` - The LogLevel to set

#### getSessionOpenedLogLevel

    public LogLevel getSessionOpenedLogLevel()

Get the LogLevel for the SessionOpened event.

Returns:
  The LogLevel for the SessionOpened eventType

#### setSessionIdleLogLevel

    public void setSessionIdleLogLevel(LogLevel level)

Set the LogLevel for the SessionIdle event.

Parameters:
  `level` - The LogLevel to set

#### getSessionIdleLogLevel

    public LogLevel getSessionIdleLogLevel()

Get the LogLevel for the SessionIdle event.

Returns:
  The LogLevel for the SessionIdle eventType

#### setSessionClosedLogLevel

    public void setSessionClosedLogLevel(LogLevel level)

Set the LogLevel for the SessionClosed event.

Parameters:
  `level` - The LogLevel to set

#### getSessionClosedLogLevel

    public LogLevel getSessionClosedLogLevel()

Get the LogLevel for the SessionClosed event.

Returns:
  The LogLevel for the SessionClosed eventType

#### getMessageSentLevel

    public LogLevel getMessageSentLevel()

Get the LogLevel for the messageSent event.

Returns:
  The LogLevel for the messageSent eventType

#### setMessageSentLevel

    public void setMessageSentLevel(LogLevel messageSentLevel)

Set the LogLevel for the messageSent event.

Parameters:
  `level` - The LogLevel to set