time:2025-04-18 15:01:28 Tech Trends
log4j file name configuration
log4j supports two configuration file formats, one is an XML file and the other is a Java feature file (key = value). The configuration is as follows:
1. Configure the root logger with the following syntax: log4j.rootLogger = [level], appenderName1, appenderName2, .... The level is the log output level, which has five levels: FATAL, ERROR, WARN, INFO, and DEBUG.
2. Configure the log output destination Appender, and its syntax is log4j.appender.appenderName = fully.qualified.name.of.appender.class. Among them, Log4j provides the following appenders: ConsoleAppender, FileAppender, DailyRollingFileAppender (generates a log file every day), RollingFileAppender (generates a new file when the file size reaches a specified size), WriterAppender (sends log information in a streaming format to any specified location).
3. Configure the format (layout) of log information, and the syntax is as follows: log4j.appender.appenderName.layout = fully.qualified.name.of.layout.class. Among them, Log4j provides the following layouts: HTMLLayout (layout in the form of HTML table), PatternLayout (you can flexibly specify the layout mode), SimpleLayout (contains the level and information string of log information), TTCCLayout (contains the time, thread, category, etc. of the log).
《log4j configuration file》 This does not represent the views of this website. If there is any infringement, please contact us to delete it.
Latest article
Huawei Mate60RS Extraordinary Master how to check the battery health
Tutorial on taking dynamic photos with the Honor 80 GT
How do I set the lock screen of Honor 200 to be always-on?
Do not allow the USB flash drive of the phone to automatically create folders
How to restore factory settings of Zhongbai laptop
Huawei P60Pro where to check the local number
Does vivo X100 Ultra have wireless charging?
How about Redmi K60E playing Genshin Impact
Draw the largest triangle in a parallelogram
How does Redmi K60 Ultra look at memory usage
Can Apple tablets change their own batteries?
How to adjust iPhone14 to 4G network
What does it mean to overclock your graphics card?
The Polaroid photograph shading film does not pop up
Huawei Nova11Ultra How to solve the Glory of Kings stuttering
OPPOA1 Vitality Edition Casting Tutorial
How much time does it take for this full charge of the Xiaomi 13
The computer's hard drive disappears after restarting
iPhone text message icon deleted how to recover
How to solve the Honor Magic5 charging too slowly
Digital Insights