public interface LoggingService
Describe the underlying logging system. Jooby provides two implementation: jooby-logback and
jooby-log4j. You might want to add one of these to your classpath, yet still these are optional.
- Since:
- 3.0.1
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
configure
(ClassLoader classLoader, List<String> names) Initializes thelogback.configurationFile
system property when alogback[.env].xml
file is found atuser.dir/conf
directory oruser.dir
.List of possible names for configuration file.System property to instruct the logging system where the configuration file is.void
logOff
(List<String> logger, SneakyThrows.Runnable task) Utility method to temporarily turn OFF a logger while running an action.
-
Method Details
-
getPropertyName
String getPropertyName()System property to instruct the logging system where the configuration file is. Example:logback.configurationFile = ...
- Returns:
- System property to instruct the logging system where the configuration file is.
-
getLogFileName
List of possible names for configuration file. Like:logback.xml, log4j.properties, etc..
.- Returns:
- List of possible names for configuration file.
-
logOff
Utility method to temporarily turn OFF a logger while running an action.- Parameters:
logger
- List of logger names.task
- Action to run.
-
configure
Initializes thelogback.configurationFile
system property when alogback[.env].xml
file is found atuser.dir/conf
directory oruser.dir
.Initializes the
log4j.configurationFile
system property when alog4j[.env].[ext]
file is found atuser.dir/conf
directory oruser.dir
. Extension can be one of:.xml
,.properties
,.yaml
or.json
.- Parameters:
classLoader
- Class loader to use.names
- Actives environment names. Useful for choosing an environment specific logging configuration file.
-