log4j 2 adding multiple colors to console appender

前端 未结 6 624
耶瑟儿~
耶瑟儿~ 2020-12-13 04:17

Hi I just downloaded and configured log4j-2. I am stuck on applying color codes to the SlowConsole console appender. My console appender is like below.

6条回答
  •  借酒劲吻你
    2020-12-13 04:37

    Spring Boot style:

    
      
        %d{yyyy-MM-dd HH:mm:ss.SSS} %highlight{${LOG_LEVEL_PATTERN:-%5p}}{FATAL=red, ERROR=red, WARN=yellow, INFO=green, DEBUG=green, TRACE=green} %style{${sys:PID}}{magenta} --- [%15.15t] %style{%-40.40c{1.}}{cyan} : %m%n%ex
      
    
    
    
      
        
      
    
    

提交回复
热议问题