Class Log4j2Helper


  • public class Log4j2Helper
    extends Object
    Since:
    2.12
    Author:
    Michiel Meeuwissen
    • Method Detail

      • debugOrInfo

        public static void debugOrInfo​(org.apache.logging.log4j.Logger logger,
                                       boolean info,
                                       String format,
                                       Object... argArray)
      • log

        public static void log​(org.apache.logging.log4j.Logger log,
                               Level level,
                               CharSequence format,
                               Object... argArray)
      • log

        public static void log​(org.apache.logging.log4j.Logger log,
                               org.slf4j.event.Level level,
                               CharSequence format,
                               Object... argArray)
      • log

        public static void log​(org.apache.logging.log4j.Logger log,
                               Duration duration,
                               Duration durationInfo,
                               String format,
                               Object... argArray)
        Issues a log entry, where the level is dependent on 2 durations
        Parameters:
        duration - The duration something took
        durationInfo - A duration to compare with. The used level will be Level.INFO if duration bigger than this. Other thresholds are multiples of this.
      • slf4j

        public static org.slf4j.Logger slf4j​(org.apache.logging.log4j.Logger logger)
      • returnAndWarn

        public static String returnAndWarn​(@NonNull org.apache.logging.log4j.Logger logger,
                                           @NonNull String format,
                                           Object... arg)
      • returnAndInfo

        public static String returnAndInfo​(@NonNull org.apache.logging.log4j.Logger logger,
                                           @NonNull String format,
                                           Object... arg)