Class EdalRequestLog
- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- de.ipk_gatersleben.bit.bi.edal.primary_data.EdalAbstractRequestLog
-
- de.ipk_gatersleben.bit.bi.edal.primary_data.EdalRequestLog
-
- All Implemented Interfaces:
org.eclipse.jetty.server.RequestLog
,org.eclipse.jetty.util.component.LifeCycle
public class EdalRequestLog extends EdalAbstractRequestLog implements org.eclipse.jetty.server.RequestLog
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener
-
-
Field Summary
-
Fields inherited from class de.ipk_gatersleben.bit.bi.edal.primary_data.EdalAbstractRequestLog
LOG
-
-
Constructor Summary
Constructors Constructor Description EdalRequestLog()
Create request log object with default settings.EdalRequestLog(java.lang.String filename)
Create request log object with specified output file name.
-
Method Summary
Modifier and Type Method Description protected void
doStart()
Set up request logging and open log file.protected void
doStop()
Close the log file and perform cleanup.java.lang.String
getDatedFilename()
Retrieve the file name of the request log with the expanded date wildcard if the output is written to the disk usingRolloverFileOutputStream
.java.lang.String
getFilename()
Retrieve the output file name of the request log.java.lang.String
getFilenameDateFormat()
Retrieve the file name date format string.int
getRetainDays()
Retrieve the number of days before rotated log files are deleted.boolean
isAppend()
Retrieve append to log flag.protected boolean
isEnabled()
Is logging enabledvoid
setAppend(boolean append)
Set append to log flag.void
setFilename(java.lang.String filename)
Set the output file name of the request log.void
setFilenameDateFormat(java.lang.String logFileDateFormat)
Set the log file name date format.void
setRetainDays(int retainDays)
Set the number of days before rotated log files are deleted.void
write(java.lang.String requestEntry)
Write requestEntry out.-
Methods inherited from class de.ipk_gatersleben.bit.bi.edal.primary_data.EdalAbstractRequestLog
getIgnorePaths, getLogCookies, getLogDateFormat, getLogLatency, getLogLocale, getLogServer, getLogTimeZone, getPreferProxiedForAddress, isExtended, isLogDispatch, log, logExtended, setExtended, setIgnorePaths, setLogCookies, setLogDateFormat, setLogDispatch, setLogLatency, setLogLocale, setLogServer, setLogTimeZone, setPreferProxiedForAddress
-
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop, toString
-
-
-
-
Constructor Detail
-
EdalRequestLog
public EdalRequestLog()
Create request log object with default settings.
-
EdalRequestLog
public EdalRequestLog(java.lang.String filename)
Create request log object with specified output file name.- Parameters:
filename
- the file name for the request log. This may be in the format expected byRolloverFileOutputStream
-
-
Method Detail
-
setFilename
public void setFilename(java.lang.String filename)
Set the output file name of the request log. The file name may be in the format expected byRolloverFileOutputStream
.- Parameters:
filename
- file name of the request log
-
getFilename
@ManagedAttribute("file of log") public java.lang.String getFilename()
Retrieve the output file name of the request log.- Returns:
- file name of the request log
-
getDatedFilename
public java.lang.String getDatedFilename()
Retrieve the file name of the request log with the expanded date wildcard if the output is written to the disk usingRolloverFileOutputStream
.- Returns:
- file name of the request log, or null if not applicable
-
isEnabled
protected boolean isEnabled()
Description copied from class:EdalAbstractRequestLog
Is logging enabled- Specified by:
isEnabled
in classEdalAbstractRequestLog
- Returns:
- true if is enabled
-
setRetainDays
public void setRetainDays(int retainDays)
Set the number of days before rotated log files are deleted.- Parameters:
retainDays
- number of days to keep a log file
-
getRetainDays
@ManagedAttribute("number of days that log files are kept") public int getRetainDays()
Retrieve the number of days before rotated log files are deleted.- Returns:
- number of days to keep a log file
-
setAppend
public void setAppend(boolean append)
Set append to log flag.- Parameters:
append
- true - request log file will be appended after restart, false - request log file will be overwritten after restart
-
isAppend
@ManagedAttribute("existing log files are appends to the new one") public boolean isAppend()
Retrieve append to log flag.- Returns:
- value of the flag
-
setFilenameDateFormat
public void setFilenameDateFormat(java.lang.String logFileDateFormat)
Set the log file name date format.- Parameters:
logFileDateFormat
- format string that is passed toRolloverFileOutputStream
- See Also:
RolloverFileOutputStream(String, boolean, int, TimeZone, String, String)
-
getFilenameDateFormat
public java.lang.String getFilenameDateFormat()
Retrieve the file name date format string.- Returns:
- the log File Date Format
-
write
public void write(java.lang.String requestEntry) throws java.io.IOException
Description copied from class:EdalAbstractRequestLog
Write requestEntry out. (to disk or slf4j log)- Specified by:
write
in classEdalAbstractRequestLog
- Parameters:
requestEntry
- the request entry string- Throws:
java.io.IOException
- if failed to write
-
doStart
protected void doStart() throws java.lang.Exception
Set up request logging and open log file.- Overrides:
doStart
in classEdalAbstractRequestLog
- Throws:
java.lang.Exception
- See Also:
AbstractLifeCycle.doStart()
-
doStop
protected void doStop() throws java.lang.Exception
Close the log file and perform cleanup.- Overrides:
doStop
in classEdalAbstractRequestLog
- Throws:
java.lang.Exception
- See Also:
AbstractLifeCycle.doStop()
-
-