Top Description Fields Constructors Methods
org.eclipse.jetty.server

public Class RequestLogWriter

extends AbstractLifeCycle
implements Writer
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.server.RequestLog.Writer
Known Direct Subclasses
org.eclipse.jetty.server.AsyncRequestLogWriter
Annotations
@ManagedObject:Request Log writer which writes to file
Imports
java.io.IOException, .OutputStream, .OutputStreamWriter, .Writer, java.util.TimeZone, org.eclipse.jetty.util.RolloverFileOutputStream, org.eclipse.jetty.util.annotation.ManagedAttribute, .ManagedObject, org.eclipse.jetty.util.component.AbstractLifeCycle, org.eclipse.jetty.util.thread.AutoLock, org.slf4j.Logger, .LoggerFactory

Writer which outputs pre-formatted request log strings to a file using RolloverFileOutputStream.

Field Summary

Modifier and TypeField and Description
private boolean
private boolean
private String
private String
private transient OutputStream
private final AutoLock
private transient OutputStream
private int
private String
private transient Writer
private static final Logger
Inherited from org.eclipse.jetty.util.component.AbstractLifeCycle:
FAILEDSTARTEDSTARTINGSTOPPEDSTOPPING

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
protected void
doStart()

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.doStart.

Method to override to start the lifecycle
protected void
doStop()

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.doStop.

Method to override to stop the lifecycle
public String

Returns:

file name of the request log, or null if not applicable
getDatedFilename
()

Retrieve the file name of the request log with the expanded date wildcard if the output is written to the disk using RolloverFileOutputStream.

public String

Returns:

file name of the request log
getFileName
()

Retrieve the output file name of the request log.

public String

Returns:

the log File Date Format
getFilenameDateFormat
()

Retrieve the file name date format string.

public int

Returns:

number of days to keep a log file
getRetainDays
()

Retrieve the number of days before rotated log files are deleted.

public String
public boolean

Returns:

value of the flag
isAppend
()

Retrieve append to log flag.

public void
setAppend(boolean
true - request log file will be appended after restart, false - request log file will be overwritten after restart
append
)

Set append to log flag.

public void
setFilename(String
file name of the request log
filename
)

Set the output file name of the request log.

public void
setFilenameDateFormat(String
format string that is passed to RolloverFileOutputStream
logFileDateFormat
)

Set the log file name date format.

public void
setRetainDays(int
number of days to keep a log file
retainDays
)

Set the number of days before rotated log files are deleted.

public void
setTimeZone(String timeZone)

public void
Inherited from org.eclipse.jetty.util.component.AbstractLifeCycle:
addEventListenergetEventListenersgetStategetStateisFailedisRunningisStartedisStartingisStoppedisStoppingremoveEventListenersetEventListenersstartstoptoString

Field Detail

_appendback to summary
private boolean _append
_closeOutback to summary
private boolean _closeOut
_filenameback to summary
private String _filename
_filenameDateFormatback to summary
private String _filenameDateFormat
_fileOutback to summary
private transient OutputStream _fileOut
_lockback to summary
private final AutoLock _lock

Hides org.eclipse.jetty.util.component.AbstractLifeCycle._lock.

_outback to summary
private transient OutputStream _out
_retainDaysback to summary
private int _retainDays
_timeZoneback to summary
private String _timeZone
_writerback to summary
private transient Writer _writer
LOGback to summary
private static final Logger LOG

Hides org.eclipse.jetty.util.component.AbstractLifeCycle.LOG.

Constructor Detail

RequestLogWriterback to summary
public RequestLogWriter()
RequestLogWriterback to summary
public RequestLogWriter(String filename)

Method Detail

doStartback to summary
protected void doStart() throws Exception

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.doStart.

Doc from org.eclipse.jetty.util.component.AbstractLifeCycle.doStart.

Method to override to start the lifecycle

Annotations
@Override
Exceptions
Exception:
If there was a problem starting. Will cause a transition to FAILED state
doStopback to summary
protected void doStop() throws Exception

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.doStop.

Doc from org.eclipse.jetty.util.component.AbstractLifeCycle.doStop.

Method to override to stop the lifecycle

Annotations
@Override
Exceptions
Exception:
If there was a problem stopping. Will cause a transition to FAILED state
getDatedFilenameback to summary
public String getDatedFilename()

Retrieve the file name of the request log with the expanded date wildcard if the output is written to the disk using RolloverFileOutputStream.

Returns:String

file name of the request log, or null if not applicable

Annotations
@ManagedAttribute:dated filename
getFileNameback to summary
public String getFileName()

Retrieve the output file name of the request log.

Returns:String

file name of the request log

Annotations
@ManagedAttribute:filename
getFilenameDateFormatback to summary
public String getFilenameDateFormat()

Retrieve the file name date format string.

Returns:String

the log File Date Format

Annotations
@ManagedAttribute:log file name date format
getRetainDaysback to summary
public int getRetainDays()

Retrieve the number of days before rotated log files are deleted.

Returns:int

number of days to keep a log file

Annotations
@ManagedAttribute:number of days to keep a log file
getTimeZoneback to summary
public String getTimeZone()
Annotations
@ManagedAttribute:timezone of the log
isAppendback to summary
public boolean isAppend()

Retrieve append to log flag.

Returns:boolean

value of the flag

Annotations
@ManagedAttribute:if request log file will be appended after restart
setAppendback to summary
public void setAppend(boolean append)

Set append to log flag.

Parameters
append:boolean

true - request log file will be appended after restart, false - request log file will be overwritten after restart

setFilenameback to summary
public void setFilename(String filename)

Set the output file name of the request log. The file name may be in the format expected by RolloverFileOutputStream.

Parameters
filename:String

file name of the request log

setFilenameDateFormatback to summary
public void setFilenameDateFormat(String logFileDateFormat)

Set the log file name date format.

Parameters
logFileDateFormat:String

format string that is passed to RolloverFileOutputStream

See Also
RolloverFileOutputStream#RolloverFileOutputStream(String, boolean, int, TimeZone, String, String)
setRetainDaysback to summary
public void setRetainDays(int retainDays)

Set the number of days before rotated log files are deleted.

Parameters
retainDays:int

number of days to keep a log file

setTimeZoneback to summary
public void setTimeZone(String timeZone)
writeback to summary
public void write(String requestEntry) throws IOException

Implements org.eclipse.jetty.server.RequestLog.Writer.write.

Annotations
@Override