public interface UWSLog
Modifier and Type | Interface and Description |
---|---|
static class |
UWSLog.LogLevel
Indicate the level of the error: debug, info, warning or error.
|
Modifier and Type | Method and Description |
---|---|
void |
debug(java.lang.String msg)
Logs a debug message.
|
void |
debug(java.lang.String msg,
java.lang.Throwable t)
Logs a full (message+exception) debug message.
|
void |
debug(java.lang.Throwable t)
Logs an exception as a debug message.
|
void |
error(java.lang.String msg)
Logs the given error.
|
void |
error(java.lang.String msg,
java.lang.Throwable t)
Logs a full (message+exception) error message.
|
void |
error(java.lang.Throwable t)
Logs the given exception as an error.
|
java.lang.String |
getConfigString()
Get a string representing the configuration of this logger.
|
void |
info(java.lang.String msg)
Logs the given information.
|
void |
log(UWSLog.LogLevel level,
java.lang.String context,
java.lang.String message,
java.lang.Throwable error)
Generic way to log a message and/or an exception.
|
void |
logHttp(UWSLog.LogLevel level,
javax.servlet.http.HttpServletRequest request,
java.lang.String requestId,
java.lang.String message,
java.lang.Throwable error)
Log a message and/or an error in the HTTP context.
|
void |
logHttp(UWSLog.LogLevel level,
javax.servlet.http.HttpServletResponse response,
java.lang.String requestId,
JobOwner user,
java.lang.String message,
java.lang.Throwable error)
Log a message and/or an error in the HTTP context.
|
void |
logJob(UWSLog.LogLevel level,
UWSJob job,
java.lang.String event,
java.lang.String message,
java.lang.Throwable error)
Log a message and/or an error in the JOB context.
|
void |
logThread(UWSLog.LogLevel level,
java.lang.Thread thread,
java.lang.String event,
java.lang.String message,
java.lang.Throwable error)
Log a message and/or an error in the THREAD context.
|
void |
logUWS(UWSLog.LogLevel level,
java.lang.Object obj,
java.lang.String event,
java.lang.String message,
java.lang.Throwable error)
Log a message and/or an error in the general context of UWS.
|
void |
warning(java.lang.String msg)
Logs the given warning.
|
java.lang.String getConfigString()
The result of this function aims to be logged when the logging mechanism is successfully configured and ready to be used.
void log(UWSLog.LogLevel level, java.lang.String context, java.lang.String message, java.lang.Throwable error)
Note: The other functions of this class or extension, MAY be equivalent to a call to this function with some specific parameter values. It should be especially the case for the debug(...), info(...), warning(...) and error(...) functions.
level
- Level of the error (info, warning, error, ...).
SHOULD NOT be NULL, but if NULL anyway, the level
SHOULD be considered as INFOcontext
- Context of the log item (HTTP, Thread, Job, UWS, ...).
MAY be NULLmessage
- Message to log. MAY be NULLerror
- Error/Exception to log. MAY be NULLvoid debug(java.lang.String msg)
Note:
This function should be equals to:
log(LogLevel.WARNING, null, msg, null)
msg
- A DEBUG message.void debug(java.lang.Throwable t)
Note:
This function should be equals to:
log(LogLevel.WARNING, null, null, t)
t
- An exception.void debug(java.lang.String msg, java.lang.Throwable t)
Note:
This function should be equals to:
log(LogLevel.WARNING, null, msg, t)
msg
- A DEBUG message.t
- An exception.void info(java.lang.String msg)
Note:
This function should be equals to:
log(LogLevel.INFO, null, msg, null)
msg
- An INFO message.void warning(java.lang.String msg)
Note:
This function should be equals to:
log(LogLevel.WARNING, null, msg, null)
msg
- A WARNING message.void error(java.lang.String msg)
Note:
This function should be equals to:
log(LogLevel.ERROR, null, msg, null)
msg
- An ERROR message.void error(java.lang.Throwable t)
Note:
This function should be equals to:
log(LogLevel.ERROR, null, null, t)
t
- An exception.void error(java.lang.String msg, java.lang.Throwable t)
Note:
This function should be equals to:
log(LogLevel.ERROR, null, msg, t)
msg
- An ERROR message.t
- An exception.void logUWS(UWSLog.LogLevel level, java.lang.Object obj, java.lang.String event, java.lang.String message, java.lang.Throwable error)
One of the parameter is of type Object
. This object can be used
to provide more information to the log function in order to describe as
much as possible the state and/or result event.
List of all events sent by the library (case sensitive):
UWS
except in case of
error where "obj" is NULL)JobList
)JobList
)UWSUrl
)UWSUrl
)HttpServletRequest
in case of error)Result
)ErrorSummary
)JSONObject
or JSONArray
or NULL))JobOwner
,
a UWSJob
, ...)UWS
)level
- Level of the log (info, warning, error, ...).
SHOULD NOT be NULL, but if NULL anyway, the level
SHOULD be considered as INFOobj
- Object providing more information about the event/object
at the origin of this log. MAY be NULLevent
- Event at the origin of this log or action currently
executed by UWS while this log is sent.
MAY be NULLmessage
- Message to log. MAY be NULLerror
- Error/Exception to log. MAY be NULLvoid logHttp(UWSLog.LogLevel level, javax.servlet.http.HttpServletRequest request, java.lang.String requestId, java.lang.String message, java.lang.Throwable error)
Note:
When a request is received, this function is called, and then, when the
response has been written and sent to the client,
logHttp(LogLevel, HttpServletResponse, String, JobOwner, String, Throwable)
should be called. These functions should always work together.
level
- Level of the log (info, warning, error, ...).
SHOULD NOT be NULL, but if NULL anyway, the level
SHOULD be considered as INFOrequest
- HTTP request received by the service.
SHOULD NOT be NULLrequestId
- ID to use to identify this request until its response is
sent.message
- Message to log. MAY be NULLerror
- Error/Exception to log. MAY be NULLlogHttp(LogLevel, HttpServletResponse, String, JobOwner, String, Throwable)
void logHttp(UWSLog.LogLevel level, javax.servlet.http.HttpServletResponse response, java.lang.String requestId, JobOwner user, java.lang.String message, java.lang.Throwable error)
Note:
When a request is received, logHttp(LogLevel, HttpServletRequest, String, String, Throwable)
is called, and then, when the response has been written and sent to the
client, this function should be called. These functions should always
work together.
level
- Level of the log (info, warning, error, ...).
SHOULD NOT be NULL, but if NULL anyway, the level
SHOULD be considered as INFOresponse
- HTTP response sent by the service to the client.
MAY be NULL if an error occurs while writing the
responserequestId
- ID to use to identify the request to which the given
response is answering.user
- Identified user which has sent the received request.message
- Message to log. MAY be NULLerror
- Error/Exception to log. MAY be NULLlogHttp(LogLevel, HttpServletRequest, String, String, Throwable)
void logJob(UWSLog.LogLevel level, UWSJob job, java.lang.String event, java.lang.String message, java.lang.Throwable error)
List of all events sent by the library (case sensitive):
level
- Level of the log (info, warning, error, ...).
SHOULD NOT be NULL, but if NULL anyway, the level
SHOULD be considered as INFOjob
- Job from which this log comes. MAY be NULLevent
- Event at the origin of this log or action executed by
the given job while this log is sent. MAY be NULLmessage
- Message to log. MAY be NULLerror
- Error/Exception to log. MAY be NULLvoid logThread(UWSLog.LogLevel level, java.lang.Thread thread, java.lang.String event, java.lang.String message, java.lang.Throwable error)
Log a message and/or an error in the THREAD context.
List of all events sent by the library (case sensitive):
level
- Level of the log (info, warning, error, ...).
SHOULD NOT be NULL, but if NULL anyway, the level
SHOULD be considered as INFOthread
- Thread from which this log comes. MAY be NULLevent
- Event at the origin of this log or action currently
executed by the given thread while this log is sent.
MAY be NULLmessage
- Message to log. MAY be NULLerror
- Error/Exception to log. MAY be NULL