The following configuration properties are available:
directory - The directory where to create the log file. If the path is not absolute, it is relative
to the current working directory of the application. The Apache Tomcat configuration files usually specify an
absolute path for this property, ${catalina.base}/logs Default value: logsrotatable - If true, the log file will be rotated on the first write past midnight and
the filename will be {prefix}{date}{suffix}, where date is yyyy-MM-dd. If false, the file
will not be rotated and the filename will be {prefix}{suffix}. Default value: trueprefix - The leading part of the log file name. Default value: juli.suffix - The trailing part of the log file name. Default value: .logbufferSize - Configures buffering. The value of 0 uses system default buffering
(typically an 8K buffer will be used). A value of <0 forces a writer flush upon each log write. A
value >0 uses a BufferedOutputStream with the defined value but note that the system default
buffering will also be applied. Default value: -1encoding - Character set used by the log file. Default value: empty string, which means to use the
system default character set.level - The level threshold for this Handler. See the java.util.logging.Level class for
the possible levels. Default value: ALLfilter - The java.util.logging.Filter implementation class name for this Handler.
Default value: unsetformatter - The java.util.logging.Formatter implementation class name for this Handler.
Default value: org.apache.juli.OneLineFormattermaxDays - The maximum number of days to keep the log files. If the specified value is
<=0 then the log files will be kept on the file system forever, otherwise they will be kept the
specified maximum days. Default value: -1.| Modifier and Type | Class and Description |
|---|---|
| protected static class |
| Modifier and Type | Field and Description |
|---|---|
| private Integer | bufferSize
Log buffer size. |
| private volatile String | date
The as-of date for the currently open log file, or null if there is no open log file. |
| public static final int | |
| public static final int | |
| private static final ExecutorService | |
| private String | directory
The directory in which log files are created. |
| private Integer | maxDays
Maximum number of days to keep the log files |
| private Pattern | pattern
Represents a file name pattern of type {prefix}{date}{suffix}. |
| private String | prefix
The prefix that is added to log file filenames. |
| private Boolean | rotatable
Determines whether the log file is rotatable |
| private String | suffix
The suffix that is added to log file filenames. |
| private volatile PrintWriter | writer
The PrintWriter to which we are currently logging, if any. |
| protected final ReadWriteLock | writerLock
Lock used to control access to the writer. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public void | close()
Implements abstract java. Close the currently open log file (if any). |
| protected void | |
| private void | |
| public void | |
| private Path | |
| private String | |
| private String | |
| public void | |
| protected void | |
| public void | publish(LogRecord
description of the log event record)Implements abstract java. Format and publish a |
| private DirectoryStream |
| bufferSize | back to summary |
|---|---|
| private Integer bufferSize Log buffer size. | |
| date | back to summary |
|---|---|
| private volatile String date The as-of date for the currently open log file, or null if there is no open log file. | |
| DEFAULT_BUFFER_SIZE | back to summary |
|---|---|
| public static final int DEFAULT_BUFFER_SIZE | |
| DEFAULT_MAX_DAYS | back to summary |
|---|---|
| public static final int DEFAULT_MAX_DAYS | |
| DELETE_FILES_SERVICE | back to summary |
|---|---|
| private static final ExecutorService DELETE_FILES_SERVICE | |
| directory | back to summary |
|---|---|
| private String directory The directory in which log files are created. | |
| maxDays | back to summary |
|---|---|
| private Integer maxDays Maximum number of days to keep the log files | |
| pattern | back to summary |
|---|---|
| private Pattern pattern Represents a file name pattern of type {prefix}{date}{suffix}. The date is YYYY-MM-DD | |
| prefix | back to summary |
|---|---|
| private String prefix The prefix that is added to log file filenames. | |
| rotatable | back to summary |
|---|---|
| private Boolean rotatable Determines whether the log file is rotatable | |
| suffix | back to summary |
|---|---|
| private String suffix The suffix that is added to log file filenames. | |
| writer | back to summary |
|---|---|
| private volatile PrintWriter writer The PrintWriter to which we are currently logging, if any. | |
| writerLock | back to summary |
|---|---|
| protected final ReadWriteLock writerLock Lock used to control access to the writer. | |
| FileHandler | back to summary |
|---|---|
| public FileHandler() | |
| FileHandler | back to summary |
|---|---|
| public FileHandler(String directory, String prefix, String suffix) | |
| FileHandler | back to summary |
|---|---|
| public FileHandler(String directory, String prefix, String suffix, Integer maxDays) | |
| FileHandler | back to summary |
|---|---|
| public FileHandler(String directory, String prefix, String suffix, Integer maxDays, Boolean rotatable, Integer bufferSize) | |
| clean | back to summary |
|---|---|
| private void clean() | |
| close | back to summary |
|---|---|
| public void close() Implements abstract java. Close the currently open log file (if any).
| |
| closeWriter | back to summary |
|---|---|
| protected void closeWriter() | |
| configure | back to summary |
|---|---|
| private void configure() Configure from | |
| flush | back to summary |
|---|---|
| public void flush() Implements abstract java. Flush the writer.
| |
| getDirectoryAsPath | back to summary |
|---|---|
| private Path getDirectoryAsPath() | |
| getProperty | back to summary |
|---|---|
| private String getProperty(String name, String defaultValue) | |
| obtainDateFromPath | back to summary |
|---|---|
| private String obtainDateFromPath(Path path) | |
| open | back to summary |
|---|---|
| public void open() Open the new log file for the date specified by | |
| openWriter | back to summary |
|---|---|
| protected void openWriter() | |
| publish | back to summary |
|---|---|
| public void publish(LogRecord record) Implements abstract java. Format and publish a | |
| streamFilesForDelete | back to summary |
|---|---|
| private DirectoryStream | |
| Modifier and Type | Field and Description |
|---|---|
| private final ThreadGroup | |
| private final boolean | |
| private final String | |
| private final AtomicInteger |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Thread | newThread(Runnable
a runnable to be executed by new thread instance r)Implements java. Constructs a new unstarted |
| group | back to summary |
|---|---|
| private final ThreadGroup group | |
| isSecurityEnabled | back to summary |
|---|---|
| private final boolean isSecurityEnabled | |
| namePrefix | back to summary |
|---|---|
| private final String namePrefix | |
| threadNumber | back to summary |
|---|---|
| private final AtomicInteger threadNumber | |
| ThreadFactory | back to summary |
|---|---|
| public ThreadFactory(final String namePrefix) | |
| newThread | back to summary |
|---|---|
| public Thread newThread(Runnable r) Implements java. Doc from java. Constructs a new unstarted | |