public interface Logger
The setClientId(String)
method can be called to associate a client id for the current thread and its child threads for tracing and logging.
The info
, warning
, and error
methods are for general logging, at the respective level.
The entry
, exit
, data
, throwing
, methods are for tracing. Each has a number of variants allowing varying numbers of Object
type arguments
to be provided. These Object
type arguments will be converted to String
s for logging. For efficiency objects should be passed in the arguments as is to save
unnecessary conversion when trace is off (note that with this approach there is no need to use a if (Trace.enabled()))
type test when invoking the trace methods).
Modifier and Type | Field and Description |
---|---|
static String |
CLIENTID_KEY
The client id key, which can be used to record the client id by implementations of the
setClientId(String) method. |
Modifier and Type | Method and Description |
---|---|
void |
data(Object source,
String methodName)
Method data tracing.
|
void |
data(Object source,
String methodName,
Object... objects)
Method data tracing.
|
void |
data(String methodName)
Method data tracing for static classes.
|
void |
data(String methodName,
Object... objects)
Method data tracing for static classes.
|
void |
entry(Object source,
String methodName)
Method entry tracing.
|
void |
entry(Object source,
String methodName,
Object... objects)
Method entry tracing.
|
void |
entry(String methodName)
Method entry tracing for static classes.
|
void |
entry(String methodName,
Object... objects)
Method entry tracing for static classes.
|
void |
error(String message)
Logs an error message.
|
void |
error(String message,
Throwable throwable)
Logs an error message.
|
void |
exit(Object source,
String methodName)
Method exit tracing.
|
void |
exit(Object source,
String methodName,
Object result)
Method exit tracing.
|
void |
exit(String methodName)
Method exit tracing for static classes.
|
void |
exit(String methodName,
Object result)
Method exit tracing for static classes.
|
void |
ffdc(Object source,
String methodName,
FFDCProbeId probeId,
Throwable throwable,
Object... data)
Captures FFDC information.
|
void |
ffdc(String methodName,
FFDCProbeId probeId,
Throwable throwable,
Object... data)
Captures FFDC information.
|
void |
info(String message)
Logs an information message.
|
void |
setClientId(String clientId)
Associate the specified client id for the current thread, and its child threads, for tracing and logging
|
void |
throwing(Object source,
String methodName,
Throwable throwable)
Exception tracing.
|
void |
throwing(String methodName,
Throwable throwable)
Exception tracing when a throwable is caught in a static class.
|
void |
warning(String message)
Logs a warning.
|
static final String CLIENTID_KEY
setClientId(String)
method.void setClientId(String clientId)
clientId
- void info(String message)
message
- The information message text.void warning(String message)
message
- The warning message text.void error(String message)
message
- The error message text.void error(String message, Throwable throwable)
message
- The error message text.throwable
- The exception causing the error.void entry(String methodName)
methodName
- Name of the calling method.void entry(String methodName, Object... objects)
methodName
- Name of the calling method.objects
- Objects on which toString() is called.void entry(Object source, String methodName)
source
- Object making the trace call.methodName
- Name of the calling method.void entry(Object source, String methodName, Object... objects)
source
- Object making the trace call.methodName
- Name of the calling method.objects
- Objects on which toString() is called.void exit(String methodName)
methodName
- Name of the calling method.void exit(String methodName, Object result)
methodName
- Name of the calling method.result
- Object on which toString() is called, containing the return value.void exit(Object source, String methodName)
source
- Object making the trace call.methodName
- Name of the calling method.void exit(Object source, String methodName, Object result)
source
- Object making the trace call.methodName
- Name of the calling method.result
- Object on which toString() is called, containing the return value.void data(String methodName)
methodName
- Name of the calling method.void data(String methodName, Object... objects)
methodName
- Name of the calling method.objects
- Objects on which toString() is called.void data(Object source, String methodName)
source
- Object making the trace call.methodName
- Name of the calling method.void data(Object source, String methodName, Object... objects)
source
- Object making the trace call.methodName
- Name of the calling method.objects
- Objects on which toString() is called.void throwing(String methodName, Throwable throwable)
methodName
- Name of the calling method.throwable
- Causing the event.void throwing(Object source, String methodName, Throwable throwable)
source
- Object making the trace call.methodName
- Name of the calling method.throwable
- Causing the event.void ffdc(String methodName, FFDCProbeId probeId, Throwable throwable, Object... data)
methodName
- Name of the calling method.probeId
- A probe identifier that can be used to uniquely identify the point in the code that requested the data capture. The probe identifier should be unique within a
class.throwable
- The throwable that triggered capturing of FFDC information. This can be null if there is no obvious throwable cause.data
- Arbitrary data that is captured into the FFDC record.void ffdc(Object source, String methodName, FFDCProbeId probeId, Throwable throwable, Object... data)
source
- Object requesting the FFDC.methodName
- Name of the calling method.probeId
- A probe identifier that can be used to uniquely identify the point in the code that requested the data capture. The probe identifier should be unique within a
class.throwable
- The throwable that triggered capturing of FFDC information. This can be null if there is no obvious throwable cause.data
- Arbitrary data that is captured into the FFDC record.Copyright © 2015 International Business Machines Corporation. All rights reserved.