Class TomcatSlf4jLogbackAppenderAccessor
- java.lang.Object
-
- psiprobe.tools.logging.DefaultAccessor
-
- psiprobe.tools.logging.AbstractLogDestination
-
- psiprobe.tools.logging.slf4jlogback.TomcatSlf4jLogbackAppenderAccessor
-
- All Implemented Interfaces:
LogDestination
public class TomcatSlf4jLogbackAppenderAccessor extends AbstractLogDestination
A wrapper for a TomcatSlf4jLogback appender for a specific logger.
-
-
Field Summary
Fields Modifier and Type Field Description private TomcatSlf4jLogbackLoggerAccessor
loggerAccessor
The logger accessor.-
Fields inherited from class psiprobe.tools.logging.DefaultAccessor
logger
-
-
Constructor Summary
Constructors Constructor Description TomcatSlf4jLogbackAppenderAccessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getEncoding()
Gets the encoding of the file.File
getFile()
Returns the file that this appender writes to by accessing thefile
bean property of the appender.String
getIndex()
Returns the name of this appender.String
getLevel()
Gets the level of the associated logger.TomcatSlf4jLogbackLoggerAccessor
getLoggerAccessor()
Gets the logger accessor.String
getLogType()
Returns the log type, to distinguish tomcatSlf4jLogback appenders from other types like log4j appenders or jdk handlers.String
getName()
Gets the name.String[]
getValidLevels()
Returns the valid log level names.boolean
isContext()
Checks if is context.boolean
isRoot()
Checks if is root.void
setLoggerAccessor(TomcatSlf4jLogbackLoggerAccessor loggerAccessor)
Sets the logger accessor.-
Methods inherited from class psiprobe.tools.logging.AbstractLogDestination
getConversionPattern, getLastModified, getSize, getStdoutFile
-
Methods inherited from class psiprobe.tools.logging.DefaultAccessor
getApplication, getProperty, getProperty, getTarget, getTargetClass, invokeMethod, setApplication, setTarget
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface psiprobe.tools.logging.LogDestination
getApplication, getTargetClass
-
-
-
-
Field Detail
-
loggerAccessor
private TomcatSlf4jLogbackLoggerAccessor loggerAccessor
The logger accessor.
-
-
Method Detail
-
getLoggerAccessor
public TomcatSlf4jLogbackLoggerAccessor getLoggerAccessor()
Gets the logger accessor.- Returns:
- the logger accessor
-
setLoggerAccessor
public void setLoggerAccessor(TomcatSlf4jLogbackLoggerAccessor loggerAccessor)
Sets the logger accessor.- Parameters:
loggerAccessor
- the new logger accessor
-
isContext
public boolean isContext()
Description copied from interface:LogDestination
Checks if is context.- Specified by:
isContext
in interfaceLogDestination
- Overrides:
isContext
in classAbstractLogDestination
- Returns:
- true, if is context
-
isRoot
public boolean isRoot()
Description copied from interface:LogDestination
Checks if is root.- Specified by:
isRoot
in interfaceLogDestination
- Overrides:
isRoot
in classAbstractLogDestination
- Returns:
- true, if is root
-
getName
public String getName()
Description copied from interface:LogDestination
Gets the name.- Returns:
- the name
-
getLogType
public String getLogType()
Returns the log type, to distinguish tomcatSlf4jLogback appenders from other types like log4j appenders or jdk handlers.- Returns:
- the log type
-
getIndex
public String getIndex()
Returns the name of this appender.- Specified by:
getIndex
in interfaceLogDestination
- Overrides:
getIndex
in classAbstractLogDestination
- Returns:
- the name of this appender.
-
getFile
public File getFile()
Returns the file that this appender writes to by accessing thefile
bean property of the appender.If no such property exists, we assume the appender to write to stdout or stderr so the output will be contained in catalina.out.
- Specified by:
getFile
in interfaceLogDestination
- Overrides:
getFile
in classAbstractLogDestination
- Returns:
- the file this appender writes to
-
getEncoding
public String getEncoding()
Description copied from interface:LogDestination
Gets the encoding of the file.- Specified by:
getEncoding
in interfaceLogDestination
- Overrides:
getEncoding
in classAbstractLogDestination
- Returns:
- the encoding name
-
getLevel
public String getLevel()
Gets the level of the associated logger.- Specified by:
getLevel
in interfaceLogDestination
- Overrides:
getLevel
in classAbstractLogDestination
- Returns:
- the logger's level
-
getValidLevels
public String[] getValidLevels()
Returns the valid log level names.Note that Logback has no FATAL level.
- Specified by:
getValidLevels
in interfaceLogDestination
- Overrides:
getValidLevels
in classAbstractLogDestination
- Returns:
- the valid log level names
-
-