- java.lang.Object
-
- java.util.logging.Handler
-
- java.util.logging.StreamHandler
-
- java.util.logging.FileHandler
-
- io.helidon.webserver.accesslog.AccessLogHandler
-
public class AccessLogHandler extends FileHandler
Log handler to support separation of access log to its own file.This is used with Java Logging. For other frameworks, such as
slf4j
orlog4j
you can use a bridge for Java Logging and configure a separate file using implementation specific configuration.Java util logging configuration example using this handler:
# Configure the log handler (uses the same configuration options as FileHandler, ignores formatter io.helidon.webserver.accesslog.AccessLogHandler.level=FINEST io.helidon.webserver.accesslog.AccessLogHandler.pattern=access.log io.helidon.webserver.accesslog.AccessLogHandler.append=true # Configure the logger io.helidon.webserver.AccessLog.level=INFO io.helidon.webserver.AccessLog.useParentHandlers=false io.helidon.webserver.AccessLog.handlers=io.helidon.webserver.accesslog.AccessLogHandler
-
-
Constructor Summary
Constructors Constructor Description AccessLogHandler()
Construct a defaultAccessLogHandler
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setFormatter(Formatter newFormatter)
-
Methods inherited from class java.util.logging.FileHandler
close, publish
-
Methods inherited from class java.util.logging.StreamHandler
flush, isLoggable, setEncoding, setOutputStream
-
Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, reportError, setErrorManager, setFilter, setLevel
-
-
-
-
Constructor Detail
-
AccessLogHandler
public AccessLogHandler() throws IOException, SecurityException
Construct a defaultAccessLogHandler
. This will be configured entirely fromLogManager
properties (or their default values).- Throws:
IOException
- if there are IO problems opening the files.SecurityException
- if a security manager exists and if the caller does not haveLoggingPermission("control"))
.NullPointerException
- if pattern property is an empty String.
-
-
Method Detail
-
setFormatter
public void setFormatter(Formatter newFormatter) throws SecurityException
- Overrides:
setFormatter
in classHandler
- Throws:
SecurityException
-
-