类 ColorConverter

  • 所有已实现的接口:
    org.apache.logging.log4j.core.pattern.PatternConverter

    @Plugin(name="color",
            category="Converter")
    public final class ColorConverter
    extends org.apache.logging.log4j.core.pattern.LogEventPatternConverter
    Log4j2 LogEventPatternConverter colors output using the AnsiOutput class. A single option 'styling' can be provided to the converter, or if not specified color styling will be picked based on the logging level.
    从以下版本开始:
    1.3.0
    • 方法详细资料

      • newInstance

        public static ColorConverter newInstance​(org.apache.logging.log4j.core.config.Configuration config,
                                                 String[] options)
        Creates a new instance of the class. Required by Log4J2.
        参数:
        config - the configuration
        options - the options
        返回:
        a new instance, or null if the options are invalid
      • handlesThrowable

        public boolean handlesThrowable()
        覆盖:
        handlesThrowable 在类中 org.apache.logging.log4j.core.pattern.LogEventPatternConverter
      • format

        public void format​(org.apache.logging.log4j.core.LogEvent event,
                           StringBuilder toAppendTo)
        指定者:
        format 在类中 org.apache.logging.log4j.core.pattern.LogEventPatternConverter