The basic use of log4j2

Regularly delete the log:

http://www.kstrive.com/2017/10/26/log4j2_auto_delete_old_logs/

https://blog.csdn.net/z69183787/article/details/77676486

Log division:

https://blog.csdn.net/zhang168/article/details/46814489

 

 

Output basic syntax:

% d {HH: mm: ss.SSS } represents the output time to the millisecond
% t output current thread name
% -5level output log level, a left-aligned and secured -5 outputs five characters, if the right if less than 0
% logger output logger names, no names because Root Logger, there is no output
% msg text log
% n newline

Other commonly used placeholders are:
class file name% F where the output, as Log4j2Test.java
% L outputs row number
% M where the method name output
line number where the output statement% l, comprising a class name, a method name, file name the number of rows
---------------------
author: vbirdbest
source: CSDN
original: https: //blog.csdn.net/vbirdbest/article/details/71751835
copyright Disclaimer: This article is a blogger original article, reproduced, please attach Bowen link!

Guess you like

Origin www.cnblogs.com/chaojibaidu/p/10930705.html