Package liquibase.logging.core
Class JavaLogService
- java.lang.Object
-
- liquibase.logging.core.AbstractLogService
-
- liquibase.logging.core.JavaLogService
-
- All Implemented Interfaces:
LogService
,Plugin
public class JavaLogService extends AbstractLogService
-
-
Field Summary
-
Fields inherited from interface liquibase.plugin.Plugin
PRIORITY_DATABASE, PRIORITY_DEFAULT, PRIORITY_NOT_APPLICABLE, PRIORITY_SPECIALIZED
-
-
Constructor Summary
Constructors Constructor Description JavaLogService()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Formatter
getCustomFormatter()
Logger
getLog(Class clazz)
Creates a logger for logging from the given class.protected String
getLogName(Class clazz)
Because java.util.logging differentiates between the log name and the class/method logging, we can collapses the log names to a simpler/smaller set to allow configuration to rely on the class name less.Logger
getParent()
int
getPriority()
static void
setFormatterOnHandler(LogService logService, Handler handler)
Set the formatter for the supplied handler if the supplied log service is a JavaLogService and that service specifies a custom formatter.void
setParent(Logger parent)
Explicitly control the parent logger for allLogger
instances created.-
Methods inherited from class liquibase.logging.core.AbstractLogService
close, getFilter, setFilter
-
-
-
-
Method Detail
-
getPriority
public int getPriority()
-
getLog
public Logger getLog(Class clazz)
Description copied from interface:LogService
Creates a logger for logging from the given class. Unlike most logging systems, there is no exposed getLog(String) method in order to provide more consistency in how logs are named.
-
getLogName
protected String getLogName(Class clazz)
Because java.util.logging differentiates between the log name and the class/method logging, we can collapses the log names to a simpler/smaller set to allow configuration to rely on the class name less.
This implementation always returns the 2nd level liquibase package name for the class passed in OR from any liquibase interfaces/classes it implements. For example, allChange
classes will return a log name of "liquibase.change" no matter what class name or package name they have.
-
getParent
public Logger getParent()
-
setParent
public void setParent(Logger parent)
Explicitly control the parent logger for allLogger
instances created.
-
getCustomFormatter
public Formatter getCustomFormatter()
-
setFormatterOnHandler
public static void setFormatterOnHandler(LogService logService, Handler handler)
Set the formatter for the supplied handler if the supplied log service is a JavaLogService and that service specifies a custom formatter.
-
-