public class BasicRestCallLogger extends Object implements RestCallLogger
RestCallLogger
interface.
Subclasses can override these methods to tailor logging of HTTP requests.
Subclasses MUST implement a no-arg public constructor or constructor that takes in a RestContext
arg.
RestCallLogger.Null
Modifier | Constructor and Description |
---|---|
protected |
BasicRestCallLogger(Logger logger,
StackTraceDatabase stackTraceDb)
Constructor.
|
|
BasicRestCallLogger(RestContext context)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected Logger |
getLogger()
Returns the Java logger used for logging.
|
protected String |
getLoggerName()
Returns the logger name.
|
void |
log(RestCallLoggerConfig config,
HttpServletRequest req,
HttpServletResponse res)
Called at the end of a servlet request to log the request.
|
BasicRestCallLogger |
resetStackTraces()
Clears out the stack trace database.
|
public BasicRestCallLogger(RestContext context)
context
- The context of the resource object.protected BasicRestCallLogger(Logger logger, StackTraceDatabase stackTraceDb)
logger
- The logger to use for logging.stackTraceDb
- The stack trace database for maintaining stack traces.protected String getLoggerName()
By default returns the class name of the servlet class passed in to the context.
Subclasses can override this to provide their own customized logger names.
protected Logger getLogger()
Subclasses can provide their own logger.
The default implementation returns the logger created using
public BasicRestCallLogger resetStackTraces()
public void log(RestCallLoggerConfig config, HttpServletRequest req, HttpServletResponse res)
RestCallLogger
log
in interface RestCallLogger
config
- The logging configuration.req
- The servlet request.res
- The servlet response.Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.