Package org.eclipse.jetty.server
Class AbstractNCSARequestLog
- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.util.component.ContainerLifeCycle
-
- org.eclipse.jetty.server.AbstractNCSARequestLog
-
- All Implemented Interfaces:
RequestLog
,Container
,Destroyable
,Dumpable
,Dumpable.DumpableContainer
,LifeCycle
- Direct Known Subclasses:
NCSARequestLog
,Slf4jRequestLog
@Deprecated public class AbstractNCSARequestLog extends ContainerLifeCycle implements RequestLog
Deprecated.useCustomRequestLog
given format stringCustomRequestLog.EXTENDED_NCSA_FORMAT
with aRequestLog.Writer
Base implementation of theRequestLog
outputs logs in the pseudo-standard NCSA common log format. Configuration options allow a choice between the standard Common Log Format (as used in the 3 log format) and the Combined Log Format (single log format). This log format can be output by most web servers, and almost all web log analysis software can understand these formats.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.Listener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.server.RequestLog
RequestLog.Collection, RequestLog.Writer
-
-
Field Summary
Fields Modifier and Type Field Description protected RequestLog.Writer
_requestLogWriter
Deprecated.protected static Logger
LOG
Deprecated.
-
Constructor Summary
Constructors Constructor Description AbstractNCSARequestLog(RequestLog.Writer requestLogWriter)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
doStart()
Deprecated.Set up request logging and open log file.protected void
doStop()
Deprecated.Stops the managed lifecycle beans in the reverse order they were added.protected java.lang.String
getAuthentication(Request request)
Deprecated.Extract the user authenticationjava.lang.String[]
getIgnorePaths()
Deprecated.Retrieve the request paths that will not be logged.boolean
getLogCookies()
Deprecated.Retrieve log cookies flagjava.lang.String
getLogDateFormat()
Deprecated.Retrieve the timestamp format string for request log entries.boolean
getLogLatency()
Deprecated.Retrieve log request processing time flag.java.util.Locale
getLogLocale()
Deprecated.Retrieve the locale of the request log.boolean
getLogServer()
Deprecated.Retrieve log hostname flag.java.lang.String
getLogTimeZone()
Deprecated.Retrieve the timezone of the request log.boolean
getPreferProxiedForAddress()
Deprecated.Retrieved log X-Forwarded-For IP address flag.protected boolean
isEnabled()
Deprecated.Is logging enabledboolean
isExtended()
Deprecated.Retrieve the extended request log format flag.boolean
isLogDispatch()
Deprecated.void
log(Request request, Response response)
Deprecated.Writes the request and response information to the output stream.protected void
logExtended(java.lang.StringBuilder b, Request request, Response response)
Deprecated.Writes extended request and response information to the output stream.void
setExtended(boolean extended)
Deprecated.Set the extended request log format flag.void
setIgnorePaths(java.lang.String[] ignorePaths)
Deprecated.Set request paths that will not be logged.void
setLogCookies(boolean logCookies)
Deprecated.Controls logging of the request cookies.void
setLogDateFormat(java.lang.String format)
Deprecated.Set the timestamp format for request log entries in the file.void
setLogDispatch(boolean value)
Deprecated.void
setLogLatency(boolean logLatency)
Deprecated.Controls logging of request processing time.void
setLogLocale(java.util.Locale logLocale)
Deprecated.Set the locale of the request log.void
setLogServer(boolean logServer)
Deprecated.Controls logging of the request hostname.void
setLogTimeZone(java.lang.String tz)
Deprecated.Set the timezone of the request log.void
setPreferProxiedForAddress(boolean preferProxiedForAddress)
Deprecated.Controls whether the actual IP address of the connection or the IP address from the X-Forwarded-For header will be logged.void
write(java.lang.String requestEntry)
Deprecated.Write requestEntry out.-
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeans
-
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
-
-
-
Field Detail
-
LOG
protected static final Logger LOG
Deprecated.
-
_requestLogWriter
protected final RequestLog.Writer _requestLogWriter
Deprecated.
-
-
Constructor Detail
-
AbstractNCSARequestLog
public AbstractNCSARequestLog(RequestLog.Writer requestLogWriter)
Deprecated.
-
-
Method Detail
-
isEnabled
protected boolean isEnabled()
Deprecated.Is logging enabled- Returns:
- true if logging is enabled
-
write
public void write(java.lang.String requestEntry) throws java.io.IOException
Deprecated.Write requestEntry out. (to disk or slf4j log)- Parameters:
requestEntry
- the request entry- Throws:
java.io.IOException
- if unable to write the entry
-
log
public void log(Request request, Response response)
Deprecated.Writes the request and response information to the output stream.- Specified by:
log
in interfaceRequestLog
- Parameters:
request
- The request to log.response
- The response to log. Note that for some requests the response instance may not have been fully populated (Eg 400 bad request responses are sent without a servlet response object). Thus for basic log information it is best to consultResponse.getCommittedMetaData()
andResponse.getHttpChannel()
directly.- See Also:
RequestLog.log(Request, Response)
-
getAuthentication
protected java.lang.String getAuthentication(Request request)
Deprecated.Extract the user authentication- Parameters:
request
- The request to extract from- Returns:
- The string to log for authenticated user.
-
logExtended
protected void logExtended(java.lang.StringBuilder b, Request request, Response response) throws java.io.IOException
Deprecated.Writes extended request and response information to the output stream.- Parameters:
b
- StringBuilder to write torequest
- request objectresponse
- response object- Throws:
java.io.IOException
- if unable to log the extended information
-
setIgnorePaths
public void setIgnorePaths(java.lang.String[] ignorePaths)
Deprecated.Set request paths that will not be logged.- Parameters:
ignorePaths
- array of request paths
-
getIgnorePaths
public java.lang.String[] getIgnorePaths()
Deprecated.Retrieve the request paths that will not be logged.- Returns:
- array of request paths
-
setLogCookies
public void setLogCookies(boolean logCookies)
Deprecated.Controls logging of the request cookies.- Parameters:
logCookies
- true - values of request cookies will be logged, false - values of request cookies will not be logged
-
getLogCookies
public boolean getLogCookies()
Deprecated.Retrieve log cookies flag- Returns:
- value of the flag
-
setLogServer
public void setLogServer(boolean logServer)
Deprecated.Controls logging of the request hostname.- Parameters:
logServer
- true - request hostname will be logged, false - request hostname will not be logged
-
getLogServer
public boolean getLogServer()
Deprecated.Retrieve log hostname flag.- Returns:
- value of the flag
-
setLogLatency
public void setLogLatency(boolean logLatency)
Deprecated.Controls logging of request processing time.- Parameters:
logLatency
- true - request processing time will be logged false - request processing time will not be logged
-
getLogLatency
public boolean getLogLatency()
Deprecated.Retrieve log request processing time flag.- Returns:
- value of the flag
-
setLogDispatch
@Deprecated public void setLogDispatch(boolean value)
Deprecated.- Parameters:
value
- true to log dispatch
-
isLogDispatch
@Deprecated public boolean isLogDispatch()
Deprecated.- Returns:
- true if logging dispatches
-
setPreferProxiedForAddress
public void setPreferProxiedForAddress(boolean preferProxiedForAddress)
Deprecated.Controls whether the actual IP address of the connection or the IP address from the X-Forwarded-For header will be logged.- Parameters:
preferProxiedForAddress
- true - IP address from header will be logged, false - IP address from the connection will be logged
-
getPreferProxiedForAddress
public boolean getPreferProxiedForAddress()
Deprecated.Retrieved log X-Forwarded-For IP address flag.- Returns:
- value of the flag
-
setExtended
public void setExtended(boolean extended)
Deprecated.Set the extended request log format flag.- Parameters:
extended
- true - log the extended request information, false - do not log the extended request information
-
isExtended
@ManagedAttribute("use extended NCSA format") public boolean isExtended()
Deprecated.Retrieve the extended request log format flag.- Returns:
- value of the flag
-
doStart
protected void doStart() throws java.lang.Exception
Deprecated.Set up request logging and open log file.- Overrides:
doStart
in classContainerLifeCycle
- Throws:
java.lang.Exception
- See Also:
AbstractLifeCycle.doStart()
-
doStop
protected void doStop() throws java.lang.Exception
Deprecated.Description copied from class:ContainerLifeCycle
Stops the managed lifecycle beans in the reverse order they were added.- Overrides:
doStop
in classContainerLifeCycle
- Throws:
java.lang.Exception
-
setLogDateFormat
public void setLogDateFormat(java.lang.String format)
Deprecated.Set the timestamp format for request log entries in the file. If this is not set, the pre-formated request timestamp is used.- Parameters:
format
- timestamp format string
-
getLogDateFormat
public java.lang.String getLogDateFormat()
Deprecated.Retrieve the timestamp format string for request log entries.- Returns:
- timestamp format string.
-
setLogLocale
public void setLogLocale(java.util.Locale logLocale)
Deprecated.Set the locale of the request log.- Parameters:
logLocale
- locale object
-
getLogLocale
public java.util.Locale getLogLocale()
Deprecated.Retrieve the locale of the request log.- Returns:
- locale object
-
setLogTimeZone
public void setLogTimeZone(java.lang.String tz)
Deprecated.Set the timezone of the request log.- Parameters:
tz
- timezone string
-
getLogTimeZone
@ManagedAttribute("the timezone") public java.lang.String getLogTimeZone()
Deprecated.Retrieve the timezone of the request log.- Returns:
- timezone string
-
-