日志级别,浅析logback.xml和logback-test.xml,个人理解

个人理解:项目启动后,会优先加载logback-test.xml,如果没有logback-test.xml才回去寻找logback.xml,一般在项目打包中会排掉logback-test.xml。logback-test.xml中配的日志级别一般会高于logback.xml,用于测试中需要看到更多更详细的日志信息,所以在logback-test.xml中配的日志级别较logback.xml会高一些。


Off

OFF Level 是最高等级的,用于关闭所有日志记录。

FATAL 致命的错误

FATAL level 指出每个严重的错误事件将会导致应用程序的退出。

ERROR 错误

ERROR level 指出虽然发生错误事件,但仍然不影响系统的继续运行。

WARN 警告

WARN level 表明会出现潜在错误的情形。

INFO 信息

INFO level 表明 消息在粗粒度级别上突出强调应用程序的运行过程。

DEBUG 调试

DEBUG Level 指出细粒度信息事件对调试应用程序是非常有帮助的。

TRACE

与DEBUG 相比更细致化的记录事件消息。

ALL

ALL Level 是最低等级的,用于打开所有日志记录。

从高到地低

OFF 、 FATAL 、 ERROR 、 WARN 、 INFO 、 DEBUG 、 TRACE 、 ALL

Field Summary

static Level

ALL

          The ALL has the lowest possible rank and is intended to turn on all logging.

static Level

DEBUG

          The DEBUG Level designates fine-grained informational events that are most useful to debug an application.

static Level

ERROR

          The ERROR level designates error events that might still allow the application to continue running.

static Level

FATAL

          The FATAL level designates very severe error events that will presumably lead the application to abort.

static Lrevel

INFO

          The INFO level designates informational messages that highlight the progress of the application at coarse-grained level.

static Level

OFF

          The OFF has the highest possible rank and is intended to turn off logging.

static Level

TRACE

          The TRACE Level designates finer-grained informational events than the DEBUG

static int

TRACE_INT

          TRACE level integer value.

static Level

WARN

          The WARN level designates potentially harmful situations.

猜你喜欢

转载自blog.csdn.net/Soul_Programmer_Swh/article/details/80981993