public class TVCLogManager
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
TVCLogManager.LoggerInfo |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
PREFIX |
| Constructor and Description |
|---|
TVCLogManager() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addConsoleAppender(java.lang.String loggerName,
java.lang.String layoutPattern)
Add an appender to a logger.
|
static void |
addConsoleAppender(java.lang.String loggerName,
java.lang.String layoutPattern,
com.technia.tvc.log4j.Level threshold)
Add an appender to a logger.
|
static void |
addRollingFileAppender(java.lang.String loggerName,
java.lang.String layoutPattern,
java.lang.String filename)
Add an appender to a logger.
|
static void |
addRollingFileAppender(java.lang.String loggerName,
java.lang.String layoutPattern,
java.lang.String filename,
long maxFileSize,
int maxBackupFiles)
Add an appender to a logger.
|
static void |
addRollingFileAppender(java.lang.String loggerName,
java.lang.String layoutPattern,
java.lang.String filename,
long maxFileSize,
int maxBackupFiles,
com.technia.tvc.log4j.Level threshold)
Add an appender to a logger.
|
static void |
addSMTPAppender(java.lang.String loggerName,
java.lang.String layoutPattern,
java.lang.String smtpHost,
java.lang.String fromEmailAddress,
java.lang.String toEmailAddress,
java.lang.String subject,
com.technia.tvc.log4j.spi.TriggeringEventEvaluator evaluator)
Add an appender to a logger.
|
static com.technia.tvc.log4j.Logger |
createFileLogger(java.lang.String loggerName,
java.lang.String fileName,
com.technia.tvc.log4j.Level level,
java.lang.String layoutPattern,
long maxFileSize,
int maxBackupSize,
boolean keepExistingAppenders) |
static void |
debug()
Turn on debug level for entire TVC.
|
static com.technia.tvc.log4j.Level |
getLevel(java.lang.String logger) |
static java.io.File |
getLogDir() |
static java.util.Collection<TVCLogManager.LoggerInfo> |
getLoggerInfos() |
static com.technia.tvc.log4j.spi.Filter |
getNoLoggingFilter() |
static com.technia.tvc.log4j.Level |
getRootLevel() |
static com.technia.tvc.log4j.Logger |
getTVCRootLogger() |
static void |
init(java.util.Properties props)
Init Log4J sub-system based on configuration through init parameters.
|
static boolean |
isSuspended() |
static void |
list()
List logger information to stdout.
|
static void |
resume()
Resumes logging for the current thread.
|
static void |
setLevel(java.lang.String logger,
com.technia.tvc.log4j.Level level) |
static void |
setLevel(java.lang.String logger,
com.technia.tvc.log4j.Level level,
boolean deep) |
static void |
setRootLevel(com.technia.tvc.log4j.Level level)
Sets the level of the root logger.
|
static void |
setup()
Basic setup of the log4j sub-system.
|
static void |
suspend()
Suspends all logging for the current thread until
resume() is
called. |
static void |
turnOff()
Will turn off ALL logging!!!
|
public static final java.lang.String PREFIX
public static void setup()
public static void init(java.util.Properties props)
public static java.io.File getLogDir()
public static void setRootLevel(com.technia.tvc.log4j.Level level)
level - The new level.public static void setLevel(java.lang.String logger,
com.technia.tvc.log4j.Level level)
logger - The name of a logger.level - The new logger level.public static void setLevel(java.lang.String logger,
com.technia.tvc.log4j.Level level,
boolean deep)
logger - The name of a logger.level - The new logger level.deep - Whether to set the level of all loggers whose name starts
with the specified name.public static com.technia.tvc.log4j.Level getRootLevel()
public static com.technia.tvc.log4j.Level getLevel(java.lang.String logger)
logger - The name of the logger.public static void debug()
public static void turnOff()
public static void list()
public static java.util.Collection<TVCLogManager.LoggerInfo> getLoggerInfos()
public static void addConsoleAppender(java.lang.String loggerName,
java.lang.String layoutPattern)
loggerName - The name of the logger.layoutPattern - The layout pattern that will be used by the
appender.public static void addConsoleAppender(java.lang.String loggerName,
java.lang.String layoutPattern,
com.technia.tvc.log4j.Level threshold)
loggerName - The name of the logger.layoutPattern - The layout pattern that will be used by the
appender.threshold - The threshold. Log messages with a lower level than this
will not be printed.public static void addRollingFileAppender(java.lang.String loggerName,
java.lang.String layoutPattern,
java.lang.String filename)
throws java.io.IOException
loggerName - The name of the logger.layoutPattern - The layout pattern that will be used by the
appender.filename - The filename.java.io.IOExceptionpublic static void addRollingFileAppender(java.lang.String loggerName,
java.lang.String layoutPattern,
java.lang.String filename,
long maxFileSize,
int maxBackupFiles)
throws java.io.IOException
loggerName - The name of the logger.layoutPattern - The layout pattern that will be used by the
appender.filename - The filename.maxFileSize - The maximum file size.maxBackupFiles - The maximum number of backup files.java.io.IOExceptionpublic static void addRollingFileAppender(java.lang.String loggerName,
java.lang.String layoutPattern,
java.lang.String filename,
long maxFileSize,
int maxBackupFiles,
com.technia.tvc.log4j.Level threshold)
throws java.io.IOException
loggerName - The name of the logger.layoutPattern - The layout pattern that will be used by the
appender.filename - The filename.maxFileSize - The maximum file size.maxBackupFiles - The maximum number of backup files.threshold - The threshold. Log messages with a lower level than this
will not be printed.java.io.IOExceptionpublic static void addSMTPAppender(java.lang.String loggerName,
java.lang.String layoutPattern,
java.lang.String smtpHost,
java.lang.String fromEmailAddress,
java.lang.String toEmailAddress,
java.lang.String subject,
com.technia.tvc.log4j.spi.TriggeringEventEvaluator evaluator)
throws java.io.IOException
loggerName - The name of the logger.layoutPattern - The layout pattern that will be used by the
appender.smtpHost - The host to send the email to.fromEmailAddress - The from email address.toEmailAddress - The to email address.subject - The subject of the message.evaluator - Will evaluate log events and return whether they should
be sent as emails.java.io.IOExceptionpublic static com.technia.tvc.log4j.Logger createFileLogger(java.lang.String loggerName,
java.lang.String fileName,
com.technia.tvc.log4j.Level level,
java.lang.String layoutPattern,
long maxFileSize,
int maxBackupSize,
boolean keepExistingAppenders)
loggerName - fileName - level - layoutPattern - maxFileSize - maxBackupSize - keepExistingAppenders - public static com.technia.tvc.log4j.Logger getTVCRootLogger()
public static void suspend()
resume() is
called.public static void resume()
public static boolean isSuspended()
Copyright ? Technia AB. All Rights Reserved.