Layout: formatted output log information
- #custom style
- #%c The category to which the output belongs, usually the full name of the category in which it belongs
- #%C Output the name of the class where the Logger is located, usually the full name of the class where it is located
- #%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}
- #%F Output the class name of the class where it is located, only the class name.
- #%l Output the number of lines where the statement is located, including class name + method name + file name + number of lines
- #%L Output the number of lines where the statement is located, only output numbers
- #%m Output the message specified in the code, such as the message in log(message)
- #%M output method name
- #%p output log level, ie DEBUG, INFO, WARN, ERROR, FATAL
- #%r The number of milliseconds it took to output the log information since the application was started
- #%t output the name of the thread that generated the log event
- #%n output a carriage return line feed, "/r/n" for Windows platform, "/n" for Unix platform
- #%% is used to output the percent sign "%"
- #log4j.appender.Linkin.layout.ConversionPattern=%n[%l%d{yy/MM/dd HH:mm:ss:SSS}][%C-%M] %m
- #log4j.appender.Linkin.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss}[%C]-[%p] %m%n
- #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
- Console
- Loggers
- Logger
- Root
- AppenderRef