# spring-boot-plus **Repository Path**: The-Keyboard/spring-boot-plus ## Basic Information - **Project Name**: spring-boot-plus - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2025-01-10 - **Last Updated**: 2025-04-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 简介 本项目,会持续收录我在阿里工作中使用的spring扩展。 1. Controller日志打印 2. 启动bean耗时分析 # 引入依赖 ```xml io.gitee.the-keyboard spring-boot-plus 0.1.2-beta ``` # 一,Controller log打印 demo工程地址 https://gitee.com/The-Keyboard/spring-boot-plus-demo/ ### 定义log打印实现类 ```java @Component public class MyControllerLogger implements ControllerLogger { public void log(Invocation invocation) throws Exception { // 打印日志 } } ``` 除了用@Component,也可以使用其他注册bean的方法。 ### vs 【自定义@Log注解切面】的优势 1,动态性比较好,可以整合配置中心,做到实时控制哪些方法需要打印。 2,不需要去代理大量的Controller对象,大面积代理Controller是个危险的操作,内存跟性能上也有一定的优势。