Package org.jpos.util

Class RotateLogListener

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void checkSize()  
      protected void closeLogFile()  
      void destroy()  
      protected java.lang.String fileNameFromPattern​(java.lang.String inFileName, java.lang.String patternCodes)  
      LogEvent log​(LogEvent ev)  
      protected void logDebug​(java.lang.String msg)  
      void logRotate()  
      void logRotate​(boolean isStartup)  
      protected void openLogFile()  
      void setConfiguration​(Configuration cfg)
      Configure this RotateLogListener
      Properties:
      file base log filename [window] in seconds (default 0 - never rotate) [count] number of copies (default 0 == single copy) [maxsize] max log size in bytes (approx) [rotate-on-startup] Rotate file on q2 startup (default: false) [file-name-pattern] Comma-delimited codes for positional token replacement (case sensitive)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.AutoCloseable

        close
      • Methods inherited from interface java.util.function.Consumer

        andThen
    • Method Detail

      • setConfiguration

        public void setConfiguration​(Configuration cfg)
                              throws ConfigurationException
        Configure this RotateLogListener
        Properties:
        • file base log filename
        • [window] in seconds (default 0 - never rotate)
        • [count] number of copies (default 0 == single copy)
        • [maxsize] max log size in bytes (approx)
        • [rotate-on-startup] Rotate file on q2 startup (default: false)
        • [file-name-pattern] Comma-delimited codes for positional token replacement (case sensitive)

        Currently supported file-pattern-codes:

        • h - hostname lookup

        When code replacement fails, the token will be replaced by the code preceded by a # to give an indication of what failed. This type of failure will not result in a startup failure.

        file is expected to contain %s tokens for replacement when enabled, as expected by String.format.

        Specified by:
        setConfiguration in interface Configurable
        Parameters:
        cfg - Configuration
        Throws:
        ConfigurationException
      • openLogFile

        protected void openLogFile()
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • closeLogFile

        protected void closeLogFile()
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • logRotate

        public void logRotate()
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • logRotate

        public void logRotate​(boolean isStartup)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • logDebug

        protected void logDebug​(java.lang.String msg)
      • fileNameFromPattern

        protected java.lang.String fileNameFromPattern​(java.lang.String inFileName,
                                                       java.lang.String patternCodes)