public class LogConfig extends Object
Instances of this class can be created using create()
and passing the result to
MicroserviceBuilder.logConfig(LogConfig)
.
These values override values specified in the
Modifier | Constructor and Description |
---|---|
protected |
LogConfig(LogConfig copyFrom)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
LogConfig |
append()
Specified append mode for the log file.
|
LogConfig |
consoleLevel(Level consoleLevel)
The default logging level for the console.
|
LogConfig |
copy()
Creates a copy of this log configuration.
|
LogConfig |
count(int count)
The number of log files to use.
|
static LogConfig |
create()
Creates a new instance of this config.
|
LogConfig |
fileLevel(Level fileLevel)
The default logging level for the log file.
|
LogConfig |
formatter(Formatter formatter)
The log entry formatter.
|
LogConfig |
level(String logger,
Level level)
Default logging level for logger.
|
LogConfig |
levels(Map<String,Level> levels)
Default logging levels for loggers.
|
LogConfig |
limit(int limit)
The maximum number of bytes to write to any one log file.
|
LogConfig |
logDir(String logDir)
The location of the log directory to create the log file.
|
LogConfig |
logFile(String logFile)
Returns the name of the log file on the file system to store the log file for this microservice.
|
public LogConfig copy()
public static LogConfig create()
public LogConfig logFile(String logFile)
This overrides the configuration value
logFile
- The log file.public LogConfig logDir(String logDir)
This overrides the configuration value
logDir
- The log directory location as a path relative to the working directory.public LogConfig formatter(Formatter formatter)
If not specified, uses the following values pulled from the configuration to construct a LogEntryFormatter
:
formatter
- The log entry formatter.LogEntryFormatter
public LogConfig append()
public LogConfig limit(int limit)
limit
- The number of bytes.public LogConfig count(int count)
count
- The number of log files.public LogConfig fileLevel(Level fileLevel)
fileLevel
- The logging level.public LogConfig consoleLevel(Level consoleLevel)
consoleLevel
- The logging level.public LogConfig levels(Map<String,Level> levels)
levels
- A map of logger names to logger levels.Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.