Class NCSARequestLog

  • All Implemented Interfaces:
    RequestLog, org.eclipse.jetty.util.component.Container, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.LifeCycle
    Direct Known Subclasses:
    AsyncNCSARequestLog

    @Deprecated
    @ManagedObject("NCSA standard format request log")
    public class NCSARequestLog
    extends AbstractNCSARequestLog
    Deprecated.
    This RequestLog implementation 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

        org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener
      • Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container

        org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.Listener
      • Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

        org.eclipse.jetty.util.component.LifeCycle.Listener
    • Field Summary

      • Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
      • Fields inherited from interface org.eclipse.jetty.util.component.Dumpable

        KEY
    • Constructor Summary

      Constructors 
      Constructor Description
      NCSARequestLog()
      Deprecated.
      Create request log object with default settings.
      NCSARequestLog​(java.lang.String filename)
      Deprecated.
      Create request log object with specified output file name.
      NCSARequestLog​(RequestLogWriter writer)
      Deprecated.
      Create request log object given a RequestLogWriter file name.
    • 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.
      Close the log file and perform cleanup.
      java.lang.String getDatedFilename()
      Deprecated.
      Retrieve the file name of the request log with the expanded date wildcard if the output is written to the disk using RolloverFileOutputStream.
      java.lang.String getFilename()
      Deprecated.
      Retrieve the output file name of the request log.
      java.lang.String getFilenameDateFormat()
      Deprecated.
      Retrieve the file name date format string.
      int getRetainDays()
      Deprecated.
      Retrieve the number of days before rotated log files are deleted.
      boolean isAppend()
      Deprecated.
      Retrieve append to log flag.
      protected boolean isEnabled()
      Deprecated.
      Is logging enabled
      void setAppend​(boolean append)
      Deprecated.
      Set append to log flag.
      void setFilename​(java.lang.String filename)
      Deprecated.
      Set the output file name of the request log.
      void setFilenameDateFormat​(java.lang.String logFileDateFormat)
      Deprecated.
      Set the log file name date format.
      void setLogTimeZone​(java.lang.String tz)
      Deprecated.
      Set the timezone of the request log.
      void setRetainDays​(int retainDays)
      Deprecated.
      Set the number of days before rotated log files are deleted.
      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

        dumpSelf
    • Constructor Detail

      • NCSARequestLog

        public NCSARequestLog()
        Deprecated.
        Create request log object with default settings.
      • NCSARequestLog

        public NCSARequestLog​(java.lang.String filename)
        Deprecated.
        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 by RolloverFileOutputStream
      • NCSARequestLog

        public NCSARequestLog​(RequestLogWriter writer)
        Deprecated.
        Create request log object given a RequestLogWriter file name.
        Parameters:
        writer - the writer which manages the output of the formatted string produced by the RequestLog
    • Method Detail

      • setFilename

        public void setFilename​(java.lang.String filename)
        Deprecated.
        Set the output file name of the request log. The file name may be in the format expected by RolloverFileOutputStream.
        Parameters:
        filename - file name of the request log
      • getFilename

        @ManagedAttribute("file of log")
        public java.lang.String getFilename()
        Deprecated.
        Retrieve the output file name of the request log.
        Returns:
        file name of the request log
      • getDatedFilename

        public java.lang.String getDatedFilename()
        Deprecated.
        Retrieve the file name of the request log with the expanded date wildcard if the output is written to the disk using RolloverFileOutputStream.
        Returns:
        file name of the request log, or null if not applicable
      • setRetainDays

        public void setRetainDays​(int retainDays)
        Deprecated.
        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()
        Deprecated.
        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)
        Deprecated.
        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()
        Deprecated.
        Retrieve append to log flag.
        Returns:
        value of the flag
      • setFilenameDateFormat

        public void setFilenameDateFormat​(java.lang.String logFileDateFormat)
        Deprecated.
        Set the log file name date format.
        Parameters:
        logFileDateFormat - format string that is passed to RolloverFileOutputStream
        See Also:
        RolloverFileOutputStream(String, boolean, int, TimeZone, String, String)
      • getFilenameDateFormat

        public java.lang.String getFilenameDateFormat()
        Deprecated.
        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
        Deprecated.
        Description copied from class: AbstractNCSARequestLog
        Write requestEntry out. (to disk or slf4j log)
        Overrides:
        write in class AbstractNCSARequestLog
        Parameters:
        requestEntry - the request entry
        Throws:
        java.io.IOException - if unable to write the entry
      • doStart

        protected void doStart()
                        throws java.lang.Exception
        Deprecated.
        Set up request logging and open log file.
        Overrides:
        doStart in class AbstractNCSARequestLog
        Throws:
        java.lang.Exception
        See Also:
        AbstractLifeCycle.doStart()
      • doStop

        protected void doStop()
                       throws java.lang.Exception
        Deprecated.
        Close the log file and perform cleanup.
        Overrides:
        doStop in class AbstractNCSARequestLog
        Throws:
        java.lang.Exception
        See Also:
        AbstractLifeCycle.doStop()