public class ConnectionMessage extends SqlMessage implements org.apache.logging.log4j.message.Message
SqlMessage
related to connection events.net.sf.log4jdbc.log4j2.Log4j2SpyLogDelegator#connectionOpened(Spy, long)
,
net.sf.log4jdbc.log4j2.Log4j2SpyLogDelegator#connectionClosed(Spy, long)
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
ConnectionMessage.Operation
An
enum to define the value of operation
when the action on the connection was to open,close or abort it. |
nl
Constructor and Description |
---|
ConnectionMessage()
Default constructor
|
ConnectionMessage(Spy spy,
long execTime,
ConnectionMessage.Operation operation,
boolean isDebugEnabled) |
Modifier and Type | Method and Description |
---|---|
protected void |
buildMessage()
Populate the
message attribute. |
getDebugInfo, getFormat, getFormattedMessage, getMessage, getParameters, getThrowable, isDebugEnabled, processSql, setDebugEnabled, setMessage
public ConnectionMessage()
public ConnectionMessage(Spy spy, long execTime, ConnectionMessage.Operation operation, boolean isDebugEnabled)
spy
- ConnectionSpy
that was opened or closed.execTime
- A long
defining the time elapsed to open or close the connection in ms
Caller should pass -1 if not usedoperation
- an int
to define if the operation was to open, or to close connection.
Should be equals to OPENING
if the operation was to open the connection,
to CLOSING
if the operation was to close the connection.isDebugEnabled
- A boolean
to define whether debugInfo should be displayed.protected void buildMessage()
SqlMessage
message
attribute.
All subclasses can implement this method as they want,
but the outcome must be to assign a String
not null
to the message
attribute.
This method is called only when this Message
is actually logged,
avoiding useless concatenation costs, etc.buildMessage
in class SqlMessage
SqlMessage.message
Copyright © 2013 Bgee - Swiss Institute of Bioinformatics. All Rights Reserved.