Class TDILog4j

  • All Implemented Interfaces:
    LogInterface

    public class TDILog4j
    extends java.lang.Object
    implements LogInterface
    Implements LogInterface for org.apache.log4j
    • Constructor Summary

      Constructors 
      Constructor Description
      TDILog4j()
      Public constructor
      TDILog4j​(org.apache.logging.log4j.Logger logger)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addAppender​(LogConfigItem config, java.util.Map<java.lang.String,​java.lang.Object> map)
      Add an Appender to the Logger using the given config.
      void addDailyRollingFile​(LogConfigItem lci, java.util.Map<java.lang.String,​java.lang.Object> map)  
      void addFile​(LogConfigItem lci, java.util.Map<java.lang.String,​java.lang.Object> map)  
      void addIDIFileRoller​(LogConfigItem lci, java.util.Map<java.lang.String,​java.lang.Object> map)  
      void addSyslog​(LogConfigItem lci, java.util.Map<java.lang.String,​java.lang.Object> map)  
      SystemLogAppender addSystemLogAppender​(LogConfigItem lci, java.util.Map<java.lang.String,​java.lang.Object> map)  
      void close()
      Free up all resources this logger uses.
      void debug​(java.lang.String str)
      Log a message with level debug.
      void error​(java.lang.String str)
      Log a message with level error.
      void error​(java.lang.String str, java.lang.Throwable error)
      Log a message with level error, and an additional Throwable.
      void fatal​(java.lang.String str)
      Log a message with level fatal.
      void fatal​(java.lang.String str, java.lang.Throwable error)
      Log a message with level fatal, and an additional Throwable.
      void info​(java.lang.String str)
      Log a message with level info.
      boolean isDebugEnabled()
      Check if a debug message would be logged.
      void log​(java.lang.String level, java.lang.String str)
      Log a message with the specified level.
      void setCategory​(java.lang.String category)
      Set the category for this Logger.
      void setLevel​(java.lang.String level)  
      java.lang.String substitute​(java.lang.String s, java.util.Map<java.lang.String,​java.lang.Object> map)  
      void warn​(java.lang.String str)
      Log a message with level warning.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • myLogger

        public org.apache.logging.log4j.Logger myLogger
      • LOGGING_CLOSE

        public java.lang.String LOGGING_CLOSE
    • Constructor Detail

      • TDILog4j

        public TDILog4j()
        Public constructor
      • TDILog4j

        public TDILog4j​(org.apache.logging.log4j.Logger logger)
    • Method Detail

      • setCategory

        public void setCategory​(java.lang.String category)
        Description copied from interface: LogInterface
        Set the category for this Logger. This method specifies a category, to allow a category based configuration.
        Specified by:
        setCategory in interface LogInterface
        Parameters:
        category - The category to use.
      • addAppender

        public void addAppender​(LogConfigItem config,
                                java.util.Map<java.lang.String,​java.lang.Object> map)
                         throws java.lang.Exception
        Description copied from interface: LogInterface
        Add an Appender to the Logger using the given config. Appender is the log4j name, java.util.logging would call it a Handler. May throw an Exception if the config does not make sense.
        The params Map may contain these keys to help set up the Appender:
        • TYPE: "AssemblyLine" or ""
        • NAME: A String with the name of component
        • CONFIG_INSTANCE: a RSInterface
        • TIME: a String with the time in milliseconds
        Specified by:
        addAppender in interface LogInterface
        Parameters:
        config - The LogConfigItem.
        map - Extra information that may be useful/
        Throws:
        java.lang.Exception
      • addSystemLogAppender

        public SystemLogAppender addSystemLogAppender​(LogConfigItem lci,
                                                      java.util.Map<java.lang.String,​java.lang.Object> map)
                                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addDailyRollingFile

        public void addDailyRollingFile​(LogConfigItem lci,
                                        java.util.Map<java.lang.String,​java.lang.Object> map)
                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addIDIFileRoller

        public void addIDIFileRoller​(LogConfigItem lci,
                                     java.util.Map<java.lang.String,​java.lang.Object> map)
                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addFile

        public void addFile​(LogConfigItem lci,
                            java.util.Map<java.lang.String,​java.lang.Object> map)
                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addSyslog

        public void addSyslog​(LogConfigItem lci,
                              java.util.Map<java.lang.String,​java.lang.Object> map)
                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • substitute

        public java.lang.String substitute​(java.lang.String s,
                                           java.util.Map<java.lang.String,​java.lang.Object> map)
      • debug

        public void debug​(java.lang.String str)
        Log a message with level debug.
        Specified by:
        debug in interface LogInterface
        Parameters:
        str - The string to be logged
      • info

        public void info​(java.lang.String str)
        Log a message with level info.
        Specified by:
        info in interface LogInterface
        Parameters:
        str - The string to be logged
      • warn

        public void warn​(java.lang.String str)
        Log a message with level warning.
        Specified by:
        warn in interface LogInterface
        Parameters:
        str - The string to be logged
      • error

        public void error​(java.lang.String str)
        Log a message with level error.
        Specified by:
        error in interface LogInterface
        Parameters:
        str - The string to be logged
      • error

        public void error​(java.lang.String str,
                          java.lang.Throwable error)
        Log a message with level error, and an additional Throwable.
        Specified by:
        error in interface LogInterface
        Parameters:
        str - The string to be logged
        error - The Throwable to be logged
      • fatal

        public void fatal​(java.lang.String str)
        Log a message with level fatal.
        Specified by:
        fatal in interface LogInterface
        Parameters:
        str - The string to be logged
      • fatal

        public void fatal​(java.lang.String str,
                          java.lang.Throwable error)
        Log a message with level fatal, and an additional Throwable.
        Specified by:
        fatal in interface LogInterface
        Parameters:
        str - The string to be logged
        error - The Throwable to be logged
      • log

        public void log​(java.lang.String level,
                        java.lang.String str)
        Log a message with the specified level.
        Specified by:
        log in interface LogInterface
        Parameters:
        level - The level to use when logging.
        str - The string to be logged
      • isDebugEnabled

        public boolean isDebugEnabled()
        Check if a debug message would be logged.
        Specified by:
        isDebugEnabled in interface LogInterface
        Returns:
        true if a debug message might be logged
      • setLevel

        public void setLevel​(java.lang.String level)
      • close

        public void close()
        Free up all resources this logger uses. The logger will not be called anymore.
        Specified by:
        close in interface LogInterface