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 String |
getDefaultResponseLogMessage(Response response,
int duration)
Format a log entry using the default IIS log format.
|
String |
getLogFormat()
Deprecated.
Use the
getResponseLogFormat() method instead. |
Template |
getLoggableTemplate()
Returns the URI template of loggable resource references.
|
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.
|
String |
getResponseLogFormat()
Returns the format used when logging responses.
|
String |
getResponseLogMessage(Response response,
int duration)
Format an access log entry.
|
protected boolean |
isDebugging()
Indicates if the debugging mode is enabled.
|
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)
Indicates if the debugging mode is enabled.
|
void |
setIdentityCheck(boolean identityCheck)
Indicates if the identity check (as specified by RFC1413) is enabled.
|
void |
setLogFormat(String responseLogFormat)
Deprecated.
Use
setResponseLogFormat(String) instead. |
void |
setLoggableTemplate(String loggableTemplateRef)
Sets the URI template of loggable resource references.
|
void |
setLoggableTemplate(Template loggableTemplate)
Sets the URI template of loggable resource references.
|
void |
setLoggerName(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(String logPropertiesUri)
Sets the URI reference of the log properties.
|
void |
setResponseLogFormat(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 String getDefaultResponseLogMessage(Response response, int duration)
response
- The response to log.duration
- The call duration (in milliseconds).@Deprecated public String getLogFormat()
getResponseLogFormat()
method instead.for format syntax and variables.
public Template getLoggableTemplate()
Request.getResourceRef()
public String getLoggerName()
public Reference getLogPropertiesRef()
public String getResponseLogFormat()
for format syntax and variables.
public String getResponseLogMessage(Response response, int duration)
response
- The response to log.duration
- The call duration.protected boolean isDebugging()
public boolean isIdentityCheck()
public boolean isLoggable(Request request)
getLoggableTemplate()
URI template otherwise is returns true.request
- The request to log.protected void setDebugging(boolean debugging)
debugging
- True if the debugging mode is enabled.public void setIdentityCheck(boolean identityCheck)
identityCheck
- True if the identity check is enabled.@Deprecated public void setLogFormat(String responseLogFormat)
setResponseLogFormat(String)
instead.responseLogFormat
- The format to use when logging responses.for format syntax and variables.
public void setLoggableTemplate(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(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(String logPropertiesUri)
logPropertiesUri
- The URI reference of the log properties.public void setResponseLogFormat(String responseLogFormat)
responseLogFormat
- The format to use when logging responses.for format syntax and variables.
public void start() throws Exception
getLogPropertiesRef()
returns a non null URI reference.Copyright © 2005–2013. All rights reserved.