log4j 로깅 계층 순서
log4j 로깅의 계층 구조는 무엇입니까?
DEBUG
INFO
WARN
ERROR
FATAL
다음 중 문제를 해결하는 데 도움이되는 가장 높은 로깅을 제공하는 것은 무엇입니까? 로깅이 발생하는 순서 나 계층을 제공 할 수 있습니까? 감사!
이 테이블이 도움이 될 수 있습니다.
첫 번째 열로 내려 가면 각 수준에서 로그가 어떻게 작동하는지 볼 수 있습니다. 즉, WARN의 경우 ( FATAL, ERROR 및 WARN )가 표시됩니다. 의 경우 OFF , 아무것도 볼 수 없습니다.
힘을 사용하고 소스를 읽으십시오 ( Priority
및 Level
클래스 에서 발췌 , TRACE 레벨은 버전 1.2.12에서 도입되었습니다).
public final static int OFF_INT = Integer.MAX_VALUE;
public final static int FATAL_INT = 50000;
public final static int ERROR_INT = 40000;
public final static int WARN_INT = 30000;
public final static int INFO_INT = 20000;
public final static int DEBUG_INT = 10000;
public static final int TRACE_INT = 5000;
public final static int ALL_INT = Integer.MIN_VALUE;
또는 클래스 의 log4j API를Level
사용하면 매우 명확합니다.
라이브러리가 특정 명령문을 인쇄할지 여부를 결정할 때 책임있는 Logger
오브젝트 의 유효 레벨 (구성을 기반으로 함)을 계산하고이를 레벨 과 비교합니다 LogEvent
(코드에서 사용한 메소드에 따라 다릅니다. trace / debug / ... / 치명적 ). 경우 LogEvent
의 레벨이 큰 경우 또는 동등 Logger
의 레벨은이 LogEvent
펜더로 전송 (들) - "인쇄". 핵심적으로, 그것은 모두 정수 비교로 귀결 되며이 상수가 작용하는 곳입니다.
OFF
FATAL
ERROR
WARN
INFO
DEBUG
TRACE
ALL
log4j 로깅 레벨의 계층 구조는 다음과 같습니다.
- 자취
- 디버그
- 정보
- 경고
- 오류
- 치명적인
- 떨어져서
TRACE 로그 수준은 문제를 해결하는 데 도움이되는 최고의 로깅을 제공합니다. 디버그 로그 수준은 문제를 해결하는 데 매우 유용합니다.
You can also refer this link for more information about log levels : https://logging.apache.org/log4j/2.0/manual/architecture.html
[Taken from http://javarevisited.blogspot.com/2011/05/top-10-tips-on-logging-in-java.html]
DEBUG is the lowest restricted java logging level and we should write everything we need to debug an application, this java logging mode should only be used on Development and Testing environment and must not be used in production environment.
INFO is more restricted than DEBUG java logging level and we should log messages which are informative purpose like Server has been started, Incoming messages, outgoing messages etc in INFO level logging in java.
WARN is more restricted than INFO java logging level and used to log warning sort of messages e.g. Connection lost between client and server. Database connection lost, Socket reaching to its limit. These messages and java logging level are almost important because you can setup alert on these logging messages in java and let your support team monitor health of your java application and react on this warning messages. In Summary WARN level is used to log warning message for logging in Java.
ERROR is the more restricted java logging level than WARN and used to log Errors and Exception, you can also setup alert on this java logging level and alert monitoring team to react on this messages. ERROR is serious for logging in Java and you should always print it.
치명적인 Java 로깅 레벨은 애플리케이션을 중단시킬 수있는 매우 심각한 오류 이벤트를 지정합니다. 이 후 대부분 응용 프로그램이 충돌하고 중지되었습니다.
OFF Java 로깅 레벨은 가능한 최고 순위이며 Java에서 로깅을 해제하기위한 것입니다.
계층 순서
- 모두
- 자취
- 디버그
- 정보
- 경고
- 오류
- 치명적인
- 떨어져서
참고 URL : https://stackoverflow.com/questions/7745885/log4j-logging-hierarchy-order
'IT' 카테고리의 다른 글
루비에서 파일을 만드는 방법 (0) | 2020.06.03 |
---|---|
iOS 7에서 UIButton 이미지를 설정하면 파란색 버튼이 나타납니다. (0) | 2020.06.03 |
Pythons glob.glob는 어떻게 주문됩니까? (0) | 2020.06.03 |
자식 행을 추가하거나 업데이트 할 수 없습니다 : 외래 키 제약 조건이 실패합니다 (0) | 2020.06.03 |
jruby에서 float를 소수점 이하 두 자리로 반올림하는 방법 (0) | 2020.06.03 |