Class AccessLogger


  • public class AccessLogger
    extends Object
    Class that logs the Http Accesses to the access log files. Code segment borrowed from Apache Tomcat's org.apache.catalina.valves.AccessLogValve with thanks.
    • Field Detail

      • fileDateFormatter

        protected SimpleDateFormat fileDateFormatter
        A date formatter to format a Date into a date in the given file format
      • writer

        protected PrintWriter writer
        The PrintWriter to which we are currently logging, if any.
      • currentLogFile

        protected File currentLogFile
        The current log file we are writing to. Helpful when checkExists is true.
      • isLoggingEnabled

        public boolean isLoggingEnabled
        Enable logging.
    • Constructor Detail

      • AccessLogger

        public AccessLogger​(org.apache.commons.logging.Log log)
    • Method Detail

      • log

        public void log​(String message)
        Log the specified message to the log file, switching files if the date has changed since the previous log call.
        Parameters:
        message - Message to be logged
      • initOpen

        protected void initOpen()
      • open

        protected void open()
        Open the new log file for the date specified by dateStamp.
      • handleThrowable

        public static void handleThrowable​(Throwable t)
        Checks whether the supplied Throwable is one that needs to be re-thrown and swallows all others.
        Parameters:
        t - the Throwable to check