io.undertow.server.handlers.accesslog

## Class DefaultAccessLogReceiver

- java.lang.Object
- - io.undertow.server.handlers.accesslog.DefaultAccessLogReceiver

All Implemented Interfaces:
  AccessLogReceiver, Closeable, AutoCloseable, Runnable

    public class DefaultAccessLogReceiver
    extends Object
    implements AccessLogReceiver, Runnable, Closeable

Log Receiver that stores logs in a directory under the specified file name, and rotates them after midnight.

Web threads do not touch the log file, but simply queue messages to be written later by a worker thread. A lightweight CAS based locking mechanism is used to ensure than only 1 thread is active writing messages at any given time

Author:
  Stuart Douglas

### Nested Class Summary

Nested Classes
`static class` `DefaultAccessLogReceiver.Builder`

### Constructor Summary

Constructors
Constructor and Description
`DefaultAccessLogReceiver(Executor logWriteExecutor, File outputDirectory, String logBaseName)`
`DefaultAccessLogReceiver(Executor logWriteExecutor, File outputDirectory, String logBaseName, String logNameSuffix)`
`DefaultAccessLogReceiver(Executor logWriteExecutor, File outputDirectory, String logBaseName, String logNameSuffix, boolean rotate)`
`DefaultAccessLogReceiver(Executor logWriteExecutor, Path outputDirectory, String logBaseName)`
`DefaultAccessLogReceiver(Executor logWriteExecutor, Path outputDirectory, String logBaseName, String logNameSuffix)`
`DefaultAccessLogReceiver(Executor logWriteExecutor, Path outputDirectory, String logBaseName, String logNameSuffix, boolean rotate)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static DefaultAccessLogReceiver.Builder` `builder()`
`void` `close()`
`void` `logMessage(String message)`
`void` `rotate()` forces a log rotation.
`void` `run()` processes all queued log messages

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

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

### Constructor Detail

#### DefaultAccessLogReceiver

    public DefaultAccessLogReceiver(Executor logWriteExecutor,
                                    File outputDirectory,
                                    String logBaseName)

#### DefaultAccessLogReceiver

    public DefaultAccessLogReceiver(Executor logWriteExecutor,
                                    File outputDirectory,
                                    String logBaseName,
                                    String logNameSuffix)

#### DefaultAccessLogReceiver

    public DefaultAccessLogReceiver(Executor logWriteExecutor,
                                    File outputDirectory,
                                    String logBaseName,
                                    String logNameSuffix,
                                    boolean rotate)

#### DefaultAccessLogReceiver

    public DefaultAccessLogReceiver(Executor logWriteExecutor,
                                    Path outputDirectory,
                                    String logBaseName)

#### DefaultAccessLogReceiver

    public DefaultAccessLogReceiver(Executor logWriteExecutor,
                                    Path outputDirectory,
                                    String logBaseName,
                                    String logNameSuffix)

#### DefaultAccessLogReceiver

    public DefaultAccessLogReceiver(Executor logWriteExecutor,
                                    Path outputDirectory,
                                    String logBaseName,
                                    String logNameSuffix,
                                    boolean rotate)

### Method Detail

#### logMessage

    public void logMessage(String message)

Specified by:
  `logMessage` in interface `AccessLogReceiver`

#### run

    public void run()

processes all queued log messages

Specified by:
  `run` in interface `Runnable`

#### rotate

    public void rotate()

forces a log rotation. This rotation is performed in an async manner, you cannot rely on the rotation being performed immediately after this method returns.

#### close

    public void close()
               throws IOException

Specified by:
  `close` in interface `Closeable`
Specified by:
  `close` in interface `AutoCloseable`
Throws:
  `IOException`

#### builder

    public static DefaultAccessLogReceiver.Builder builder()