Log4j extension uses --log formatter Layout

Layout: formatted output log information

  1. #custom style     
  2. #%c The category to which the output belongs, usually the full name of the category in which it belongs   
  3. #%C Output the name of the class where the Logger is located, usually the full name of the class where it is located   
  4. #%d Output the date or time of the log time point, the default format is ISO8601, you can also specify the format after it, for example: %d{yyy MMM dd HH:mm:ss , SSS}, %d{ABSOLUTE}, %d {DATE}  
  5. #%F Output the class name of the class where it is located, only the class name.  
  6. #%l Output the number of lines where the statement is located, including class name + method name + file name + number of lines  
  7. #%L Output the number of lines where the statement is located, only output numbers  
  8. #%m Output the message specified in the code, such as the message in log(message)  
  9. #%M output method name  
  10. #%p output log level, ie DEBUG, INFO, WARN, ERROR, FATAL  
  11. #%r The number of milliseconds it took to output the log information since the application was started  
  12. #%t output the name of the thread that generated the log event  
  13. #%n output a carriage return line feed, "/r/n" for Windows platform, "/n" for Unix platform  
  14. #%% is used to output the percent sign "%"  
  15. #log4j.appender.Linkin.layout.ConversionPattern=%n[%l%d{yy/MM/dd HH:mm:ss:SSS}][%C-%M] %m    
  16. #log4j.appender.Linkin.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss}[%C]-[%p] %m%n     
  17. #log4j.appender.Linkin.layout.ConversionPattern = %d{ABSOLUTE} %5p %t %c{2}:%L - %m%

 

pattern="[MSM] %d{yyyy-MM-dd HH:mm:ss.SSS} %p [%t] %c %m%n"

  • Configuration 
    • properties
    • Appenders 
      • Console 
        • PatternLayout
      • File
      • RollingRandomAccessFile
      • Async
    • Loggers 
      • Logger
      • Root 
        • AppenderRef

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325003535&siteId=291194637