Class ServletOutputLogTarget
java.lang.Object
org.apache.log.output.AbstractTarget
org.apache.log.output.AbstractOutputTarget
org.apache.log.output.ServletOutputLogTarget
- All Implemented Interfaces:
ErrorAware, LogTarget, Closeable
Generic logging interface. Implementations are based on the strategy
pattern.
- Author:
- Tommy Santoso
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate javax.servlet.ServletContextThe servlet context written to (may be null in which case it won't log at all) -
Constructor Summary
ConstructorsConstructorDescriptionServletOutputLogTarget(javax.servlet.ServletContext context) Constructor.ServletOutputLogTarget(javax.servlet.ServletContext context, Formatter formatter) Constructor. -
Method Summary
Methods inherited from class AbstractOutputTarget
doProcessEvent, getFormatter, openMethods inherited from class AbstractTarget
getErrorHandler, isOpen, processEvent, setErrorHandler
-
Field Details
-
m_context
private javax.servlet.ServletContext m_contextThe servlet context written to (may be null in which case it won't log at all)
-
-
Constructor Details
-
ServletOutputLogTarget
Constructor.- Parameters:
context- ServletContext to use for logging.
-
ServletOutputLogTarget
public ServletOutputLogTarget(javax.servlet.ServletContext context) Constructor.- Parameters:
context- ServletContext to use for logging.
-
-
Method Details
-
write
Logs message to servlet context log file- Overrides:
writein classAbstractOutputTarget- Parameters:
message- message to log to servlet context log file.
-
close
public void close()Shutdown target. Attempting to write to target after close() will cause errors to be logged.- Specified by:
closein interfaceCloseable- Overrides:
closein classAbstractOutputTarget
-