public class FileLogSink extends Object implements LogSink
Modifier and Type | Class and Description |
---|---|
static class |
FileLogSink.Heaplet
Creates and initializes a file log sink in a heap environment.
|
Modifier and Type | Field and Description |
---|---|
static Charset |
UTF_8
Default
Charset to use on the output file. |
LOGSINK_HEAP_KEY
Constructor and Description |
---|
FileLogSink(File file)
Builds a new FileLogSink writing entries in the given log file.
|
FileLogSink(File file,
Charset charset)
Builds a new FileLogSink writing entries in the given log file using the specified
Charset . |
Modifier and Type | Method and Description |
---|---|
boolean |
isLoggable(Name source,
LogLevel level)
Returns
true if the entry may be logged based on its source and/or level. |
void |
log(LogEntry entry)
Logs an entry.
|
void |
setLevel(LogLevel level)
Sets the level of log entries to display in the file.
|
public FileLogSink(File file)
file
- output where entries will be written (default to UTF-8 Charset)public FileLogSink(File file, Charset charset)
Charset
.file
- output where entries will be written (default to UTF-8 Charset)charset
- Character set to encode log output withpublic void setLevel(LogLevel level)
level
- level of log entries to display in the filepublic boolean isLoggable(Name source, LogLevel level)
LogSink
true
if the entry may be logged based on its source and/or level. This
does not guarantee that the entry will in fact be logged.isLoggable
in interface LogSink
source
- the object and/or event related to the log entry.level
- the logging level of the log entry.true
if the entry may be logged.Copyright © 2014 ForgeRock AS. All rights reserved.