|
Apache Tomcat 6.0.53 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.logging.Handler org.apache.juli.FileHandler
public class FileHandler
Implementation of Handler that appends log messages to a file named {prefix}{date}{suffix} in a configured directory.
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: logs
rotatable
- 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: true
prefix
- The leading part of the log file name.
Default value: juli.
suffix
- The trailing part of the log file name. Default value: .log
bufferSize
- 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: -1
encoding
- 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: ALL
filter
- 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:
java.util.logging.SimpleFormatter
Field Summary | |
---|---|
protected java.util.concurrent.locks.ReadWriteLock |
writerLock
Lock used to control access to the writer. |
Constructor Summary | |
---|---|
FileHandler()
|
|
FileHandler(java.lang.String directory,
java.lang.String prefix,
java.lang.String suffix)
|
Method Summary | |
---|---|
void |
close()
Close the currently open log file (if any). |
protected void |
closeWriter()
|
void |
flush()
Flush the writer. |
protected void |
open()
Open the new log file for the date specified by date . |
protected void |
openWriter()
|
void |
publish(java.util.logging.LogRecord record)
Format and publish a LogRecord. |
Methods inherited from class java.util.logging.Handler |
---|
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.concurrent.locks.ReadWriteLock writerLock
Constructor Detail |
---|
public FileHandler()
public FileHandler(java.lang.String directory, java.lang.String prefix, java.lang.String suffix)
Method Detail |
---|
public void publish(java.util.logging.LogRecord record)
publish
in class java.util.logging.Handler
record
- description of the log eventpublic void close()
close
in class java.util.logging.Handler
protected void closeWriter()
public void flush()
flush
in class java.util.logging.Handler
protected void open()
date
.
protected void openWriter()
|
Apache Tomcat 6.0.53 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |