- Mastering Spring Boot 2.0
- Dinesh Rajput
- 154字
- 2021-06-25 21:29:16
Fine-tuning with logging
Logging is very important in each application to debug and analyze the application's bugs during runtime. If you are working with the old-fashioned Spring Framework, then you have to configure the logging framework explicitly in your application. But Spring Boot provides support for several logging frameworks and also allows you to customize and fine-tune logging in to your Spring application. Spring Boot includes, by default:
- SLF4J: Logging facade
- Logback: SLF4J implementation
But as a best practice, stick to default logging in your application and use the SLF4J abstraction in the application code. Spring Boot also supports other logging frameworks such as Java Util Logging, Log4J, and Log4J2. You can use another logging frameworks by just adding a dependency, as follows:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-websocket</artifactId> <exclusions> <exclusion> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> </dependency>
According to this code, we are using log4j12 instead of the logback logging framework. Let's see how to configure logging output in a Spring application.
- Word排版技術大全(第2版)
- Excel 2007函數與公式實戰技巧精粹
- 遠程辦公效率手冊
- Salesforce Platform Developer I Certification Guide
- Office 2016從新手到高手
- Word/Excel/PPT 2016商務辦公從新手到高手
- Excel辦公高手應用技巧
- 新手易學:Word 2010+Excel 2010+PowerPoint 2010三合一
- Office 2013辦公應用從入門到精通
- PPT制作應用大全
- Office 2007中文版實用教程
- PPT2013制作超級應用大全(實戰案例版)
- 游戲美術設計
- 一看即會:電腦組裝·系統安裝·日常維護與故障排除(超值視頻教學版)
- Excel數據處理與分析一本通