Top Fields Constructors Methods
liquibase.logging.core

public Class JavaLogService

extends AbstractLogService
Class Inheritance
Imports
liquibase.logging.LogService, .Logger, liquibase.serializer.LiquibaseSerializable, java.util.HashMap, .Map, java.util.logging.Formatter, .Handler

Field Summary

Modifier and TypeField and Description
private final Map<Class<T>, JavaLogger>
private Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Formatter
public Logger
getLog(Class<T> clazz)

Implements liquibase.logging.LogService.getLog.

Creates a logger for logging from the given class.

protected String
getLogName(Class<T> 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.

public Logger
public int
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.

public void
setParent(Logger parent)

Explicitly control the parent logger for all java.util.logging.Logger instances created.

Inherited from liquibase.logging.core.AbstractLogService:
closegetFiltersetFilter

Field Detail

loggersback to summary
private final Map<Class<T>, JavaLogger> loggers
parentback to summary
private Logger parent

Constructor Detail

JavaLogServiceback to summary
public JavaLogService()

Method Detail

getCustomFormatterback to summary
public Formatter getCustomFormatter()
getLogback to summary
public Logger getLog(Class<T> clazz)

Implements liquibase.logging.LogService.getLog.

Doc from liquibase.logging.LogService.getLog.

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.

Annotations
@Override
getLogNameback to summary
protected String getLogName(Class<T> 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, all liquibase.change.Change classes will return a log name of "liquibase.change" no matter what class name or package name they have.

getParentback to summary
public Logger getParent()
getPriorityback to summary
public int getPriority()

Implements liquibase.logging.LogService.getPriority.

Annotations
@Override
setFormatterOnHandlerback to summary
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.

setParentback to summary
public void setParent(Logger parent)

Explicitly control the parent logger for all java.util.logging.Logger instances created.