public class MongoLogger
extends java.lang.Object
| Constructor and Description |
|---|
MongoLogger(java.util.logging.Logger logger,
int connectionId)
Gets a logger, tied to a connection.
|
MongoLogger(java.lang.String className,
MongoLogger parentLogger)
Gets a logger, tied to a connection but no statement.
|
MongoLogger(java.lang.String className,
MongoLogger parentLogger,
int statementId)
Gets a logger, tied to a connection and a statement.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
addConnectionStatementIdsToSourceName(java.lang.String sourceName)
Add the connection and statement ids before the source name if they are available.
|
void |
log(java.util.logging.Level level,
java.lang.String msg)
Log a message, with no arguments.
|
void |
log(java.util.logging.Level level,
java.lang.String msg,
java.lang.Object[] params)
Log a message, with an array of object arguments.
|
void |
log(java.util.logging.Level level,
java.lang.String msg,
java.lang.Throwable thrown)
Log a message, with associated Throwable information.
|
protected void |
logError(java.lang.String sourceName,
java.lang.String msg,
java.lang.Throwable thrown) |
protected void |
logMethodEntry(java.lang.String sourceName,
java.lang.String callSignature)
Log a method entry.
|
public MongoLogger(java.util.logging.Logger logger,
int connectionId)
logger - The logger.connectionId - The connection id.public MongoLogger(java.lang.String className,
MongoLogger parentLogger,
int statementId)
className - The classname to find the associated logger.parentLogger - The parent logger.statementId - The statement id.public MongoLogger(java.lang.String className,
MongoLogger parentLogger)
className - The classname to find the associated logger.parentLogger - The parent logger.protected void logMethodEntry(java.lang.String sourceName,
java.lang.String callSignature)
sourceName - Name of class that issued the logging requestcallSignature - The call signature, method and arguments, to log.protected void logError(java.lang.String sourceName,
java.lang.String msg,
java.lang.Throwable thrown)
public void log(java.util.logging.Level level,
java.lang.String msg)
If the logger is currently enabled for the given message level then the given message is forwarded to all the registered output Handler objects.
level - One of the message level identifiers, e.g., SEVEREmsg - The string message (or a key in the message catalog)public void log(java.util.logging.Level level,
java.lang.String msg,
java.lang.Object[] params)
If the logger is currently enabled for the given message level then a corresponding LogRecord is created and forwarded to all the registered output Handler objects.
level - One of the message level identifiers, e.g., SEVEREmsg - The string message (or a key in the message catalog)params - array of parameters to the messagepublic void log(java.util.logging.Level level,
java.lang.String msg,
java.lang.Throwable thrown)
If the logger is currently enabled for the given message level then the given arguments are stored in a LogRecord which is forwarded to all registered output handlers.
Note that the thrown argument is stored in the LogRecord thrown property, rather than the LogRecord parameters property. Thus it is processed specially by output Formatters and is not treated as a formatting parameter to the LogRecord message property.
level - One of the message level identifiers, e.g., SEVEREmsg - The string message (or a key in the message catalog)thrown - Throwable associated with log message.protected java.lang.String addConnectionStatementIdsToSourceName(java.lang.String sourceName)
sourceName - The source name.