public class LocalFileHandler extends Handler
|=== | Name | Default Value | Description | filenamePattern | ${catalina.base}/logs/logs.%s.%03d.log | where log files are created, it uses String.format() and gives you the date and file number - in this order. | limit | 10 Megabytes | limit size indicating the file should be rotated | dateCheckInterval | 5 seconds | how often the date should be computed to rotate the file (don't do it each time for performances reason, means you can get few records of next day in a file name with current day) | bufferSize | -1 bytes | if positive the in memory buffer used to store data before flushing them to the disk | encoding | - | file encoding | level | ALL | level this handler accepts | filter | - | filter used to check if the message should be logged | formatter | java.util.logging.SimpleFormatter | formatter used to format messages | archiveDirectory | ${catalina.base}/logs/archives/ | where compressed logs are put. | archiveFormat | gzip | zip or gzip. | archiveOlderThan | -1 days | how many days files are kept before being compressed | purgeOlderThan | -1 days | how many days files are kept before being deleted, note: it applies on archives and not log files so 2 days of archiving and 3 days of purge makes it deleted after 5 days. | compressionLevel | -1 | In case of zip archiving the zip compression level (-1 for off or 0-9). | formatterPattern | - | SimpleFormatter pattern (ignored if formatter is provided). | formatterLocale | - | Locale to use. |===
NOTE: archiving and purging are done only when a file is rotated, it means it can be ignored during days if there is no logging activity.
NOTE: archiving and purging is done in a background thread pool, you can configure the number of threads in thanks to `org.apache.tomee.jul.handler.rotating.BackgroundTaskRunner.threads` property in `conf/logging.properties`. Default is 2 which should be fine for most applications.
| Modifier and Type | Class and Description |
|---|---|
static class |
LocalFileHandler.PatternFormatter |
| Constructor and Description |
|---|
LocalFileHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected String |
currentDate() |
void |
flush() |
protected String |
getProperty(String name,
String defaultValue) |
protected void |
openWriter() |
void |
publish(LogRecord record) |
protected static String |
replace(String str) |
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevelprotected String currentDate()
protected void openWriter()
Copyright © 1999–2020 The Apache Software Foundation. All rights reserved.