Log4j 面接の質問と回答
Question: Describe about logger levels in log4j.Answer: Before using log4j framework, one should be aware of different categories of log messages. Following are 5 categories:DEBUG The DEBUG Level is used to indicate events that are useful to debug an application. Handling method for DEBUG level is: debug(). INFO INFO level is used to highlight the progress of the application. Handling method for INFO level is: info(). WARN The WARN level is used to indicate potentially harmful situations. Handling method for WARN level is: warn(). ERROR The ERROR level shows errors messages that might not be serious enough and allow the application to continue. Handling method for ERROR level is: error(). FATAL The Fatal level is used to indicate severe events that will may cause abortion of the application. Handling method for FATAL level is: fatal(). If you declare log level as debug in the configuration file, then all the other log messages will also be recorded. If you declare log level as info in the configuration file, then info, warn, error and fatal log messages will be recorded. If you declare log level as warn in the configuration file, then warn, error and fatal log messages will be recorded. If you declare log level as error in the configuration file, then error and fatal log messages will be recorded. If you declare log level as fatal in the configuration file, then only fatal log messages will be recorded. |
復習用に保存
この項目をブックマークに追加したり、難しい内容としてマークしたり、復習セットに入れたりできます。
役に立ちましたか? はい いいえ
ユーザー評価で最も役立つ内容:
- What is Log4j?
- What are the different logging levels?
- Describe about logger levels in log4j.
- What are the three main components in log4j?
- What is the importance of logging applications?