public class LogService extends Service
Template
. Modifier and Type | Field and Description |
---|---|
protected Template |
responseLogTemplate
The response log template to use.
|
Constructor and Description |
---|
LogService()
Constructor.
|
LogService(boolean enabled)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Filter |
createInboundFilter(Context context)
Create the filter that should be invoked for incoming calls.
|
protected java.lang.String |
getDefaultResponseLogMessage(Response response,
int duration)
Format a log entry using the default IIS log format.
|
Template |
getLoggableTemplate()
Returns the URI template of loggable resource references.
|
java.lang.String |
getLoggerName()
Returns the name of the JDK's logger to use when logging access calls.
|
Reference |
getLogPropertiesRef()
Returns the URI reference of the log properties.
|
java.lang.String |
getResponseLogFormat()
Returns the format used when logging responses.
|
java.lang.String |
getResponseLogMessage(Response response,
int duration)
Format an access log entry.
|
protected boolean |
isDebugging()
Deprecated.
Rely on
Application.isDebugging() instead. |
boolean |
isIdentityCheck()
Indicates if the identity check (as specified by RFC1413) is enabled.
|
boolean |
isLoggable(Request request)
Indicates if the call should be logged during the processing chain.
|
protected void |
setDebugging(boolean debugging)
Deprecated.
Rely on
Application.setDebugging(boolean) instead. |
void |
setIdentityCheck(boolean identityCheck)
Indicates if the identity check (as specified by RFC1413) is enabled.
|
void |
setLoggableTemplate(java.lang.String loggableTemplateRef)
Sets the URI template of loggable resource references.
|
void |
setLoggableTemplate(Template loggableTemplate)
Sets the URI template of loggable resource references.
|
void |
setLoggerName(java.lang.String name)
Sets the name of the JDK's logger to use when logging access calls.
|
void |
setLogPropertiesRef(Reference logPropertiesRef)
Sets the URI reference of the log properties.
|
void |
setLogPropertiesRef(java.lang.String logPropertiesUri)
Sets the URI reference of the log properties.
|
void |
setResponseLogFormat(java.lang.String responseLogFormat)
Sets the format to use when logging responses.
|
void |
start()
Starts the log service by attempting to read the log properties if the
getLogPropertiesRef() returns a non null URI reference. |
createOutboundFilter, getContext, isEnabled, isStarted, isStopped, setContext, setEnabled, stop
protected volatile Template responseLogTemplate
public LogService()
public LogService(boolean enabled)
enabled
- True if the service has been enabled.public Filter createInboundFilter(Context context)
Service
createInboundFilter
in class Service
context
- The current context.protected java.lang.String getDefaultResponseLogMessage(Response response, int duration)
response
- The response to log.duration
- The call duration (in milliseconds).public Template getLoggableTemplate()
Request.getResourceRef()
public java.lang.String getLoggerName()
public Reference getLogPropertiesRef()
public java.lang.String getResponseLogFormat()
for format syntax and variables.
public java.lang.String getResponseLogMessage(Response response, int duration)
response
- The response to log.duration
- The call duration.@Deprecated protected boolean isDebugging()
Application.isDebugging()
instead.public boolean isIdentityCheck()
public boolean isLoggable(Request request)
getLoggableTemplate()
URI template otherwise is returns true.request
- The request to log.@Deprecated protected void setDebugging(boolean debugging)
Application.setDebugging(boolean)
instead.debugging
- True if the debugging mode is enabled.public void setIdentityCheck(boolean identityCheck)
identityCheck
- True if the identity check is enabled.public void setLoggableTemplate(java.lang.String loggableTemplateRef)
loggableTemplateRef
- The URI template of loggable resource references.setLoggableTemplate(Template)
public void setLoggableTemplate(Template loggableTemplate)
loggableTemplate
- The URI template of loggable resource references.public void setLoggerName(java.lang.String name)
name
- The name of the JDK's logger to use when logging access calls.public void setLogPropertiesRef(Reference logPropertiesRef)
logPropertiesRef
- The URI reference of the log properties.public void setLogPropertiesRef(java.lang.String logPropertiesUri)
logPropertiesUri
- The URI reference of the log properties.public void setResponseLogFormat(java.lang.String responseLogFormat)
responseLogFormat
- The format to use when logging responses.for format syntax and variables.
public void start() throws java.lang.Exception
getLogPropertiesRef()
returns a non null URI reference.Copyright © 2005-2024 Restlet.