Class LogUtil


  • public class LogUtil
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      LogUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static LoggerEx getLogger​(java.lang.String loggerName)
      Creates a LoggerEx at the given logger path.
      static LoggerEx getLogger​(java.lang.String loggerName, java.lang.Object identObject)
      Creates a LoggerEx at the given logger path.
      protected static com.google.common.cache.Cache<java.lang.String,​java.lang.Object> getMap()  
      static LoggerEx getModuleLogger​(java.lang.String moduleKey, java.lang.String loggerName)
      Creates a LoggerEx at the given logger path, first pre-pending the module name.
      static LoggerEx getModuleLogger​(java.lang.String moduleKey, java.lang.String loggerName, java.lang.Object identObject)
      Creates a LoggerEx at the given logger path, first pre-pending the module name.
      static org.slf4j.Marker getSystemEventMarker​(java.lang.String systemId)  
      static LoggerEx getSystemLogger​(java.lang.String loggerName)
      Creates a LoggerEx with an "ignition" prefix.
      static LoggerEx getSystemLogger​(java.lang.String loggerName, java.lang.Object identObject)
      Creates a LoggerEx with an "ignition" prefix and an ident object which will get prepended to each message.
      static void logOncePerMinute​(LoggerEx log, org.apache.log4j.Level level, java.lang.String message)
      Like the other overload, with secondary level null
      static void logOncePerMinute​(LoggerEx log, org.apache.log4j.Level level, java.lang.String message, java.lang.Throwable t)
      static void logOncePerMinute​(LoggerEx log, org.apache.log4j.Level level, org.apache.log4j.Level secondaryLevel, java.lang.String message)
      Logs once with the priority, and then with the secondary priority for any further occurrences within 1 minute.
      static void logOncePerMinute​(LoggerEx log, org.apache.log4j.Level level, org.apache.log4j.Level secondaryLevel, java.lang.String message, java.lang.Throwable t)
      Same as logOncePerMinute(LoggerEx, Level, Level, String) with the addition of logging a Throwable
      static void logOncePerMinute​(org.apache.log4j.Logger log, org.apache.log4j.Level level, java.lang.String message)
      Deprecated.
      static void logOncePerMinute​(org.apache.log4j.Logger log, org.apache.log4j.Level level, org.apache.log4j.Level secondaryLevel, java.lang.String message)
      Deprecated.
      protected static void startMaintenance()  
      • Methods inherited from class java.lang.Object

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

      • LogUtil

        public LogUtil()
    • Method Detail

      • getMap

        protected static com.google.common.cache.Cache<java.lang.String,​java.lang.Object> getMap()
      • getSystemEventMarker

        public static org.slf4j.Marker getSystemEventMarker​(java.lang.String systemId)
      • getSystemLogger

        public static LoggerEx getSystemLogger​(java.lang.String loggerName)
        Creates a LoggerEx with an "ignition" prefix.
        Parameters:
        loggerName - The name of the logger, with "." separating the hierarchy levels
      • getSystemLogger

        public static LoggerEx getSystemLogger​(java.lang.String loggerName,
                                               java.lang.Object identObject)
        Creates a LoggerEx with an "ignition" prefix and an ident object which will get prepended to each message.
      • getModuleLogger

        public static LoggerEx getModuleLogger​(java.lang.String moduleKey,
                                               java.lang.String loggerName)
        Creates a LoggerEx at the given logger path, first pre-pending the module name. The module name is expected to be a bundle key to look up the name of the module. If no value is found, the key itself will be used.
        Parameters:
        loggerName - The name of the logger, with "." separating the hierarchy levels
      • getModuleLogger

        public static LoggerEx getModuleLogger​(@Nonnull
                                               java.lang.String moduleKey,
                                               java.lang.String loggerName,
                                               java.lang.Object identObject)
        Creates a LoggerEx at the given logger path, first pre-pending the module name. The module name is expected to be a bundle key to look up the name of the module. If no value is found, the key itself will be used. Also allows an ident object, which will get pre-pended to each message.
      • getLogger

        public static LoggerEx getLogger​(java.lang.String loggerName)
        Creates a LoggerEx at the given logger path. For modules, the first name should be your module name.
        Parameters:
        loggerName - The name of the logger, with "." separating the hierarchy levels
      • getLogger

        public static LoggerEx getLogger​(java.lang.String loggerName,
                                         java.lang.Object identObject)
        Creates a LoggerEx at the given logger path. For modules, the first name should be your module name. Also allows an ident object, which will get pre-pended to each message.
      • logOncePerMinute

        @Deprecated
        public static void logOncePerMinute​(org.apache.log4j.Logger log,
                                            org.apache.log4j.Level level,
                                            java.lang.String message)
        Deprecated.
        Like the other overload, but doesn't log again within the time frame.
      • logOncePerMinute

        @Deprecated
        public static void logOncePerMinute​(org.apache.log4j.Logger log,
                                            org.apache.log4j.Level level,
                                            org.apache.log4j.Level secondaryLevel,
                                            java.lang.String message)
        Deprecated.
        Logs once with the priority, and then with the secondary priority for any further occurrences within 1 minute. If secondary priority is null, does not log again.
      • logOncePerMinute

        public static void logOncePerMinute​(LoggerEx log,
                                            org.apache.log4j.Level level,
                                            java.lang.String message)
        Like the other overload, with secondary level null
      • logOncePerMinute

        public static void logOncePerMinute​(@Nonnull
                                            LoggerEx log,
                                            @Nullable
                                            org.apache.log4j.Level level,
                                            @Nullable
                                            org.apache.log4j.Level secondaryLevel,
                                            java.lang.String message)
        Logs once with the priority, and then with the secondary priority for any further occurrences within 1 minute. If secondary priority is null, does not log again.
      • logOncePerMinute

        public static void logOncePerMinute​(@Nonnull
                                            LoggerEx log,
                                            @Nullable
                                            org.apache.log4j.Level level,
                                            @Nullable
                                            org.apache.log4j.Level secondaryLevel,
                                            java.lang.String message,
                                            java.lang.Throwable t)
        Same as logOncePerMinute(LoggerEx, Level, Level, String) with the addition of logging a Throwable
      • startMaintenance

        protected static void startMaintenance()