文章目录
自定义一个Spring Boot Starter 实现在日志中打印方法执行时间
1、spring-boot-starter 命名规则
Ⅰ、spring-boot-starter-XX是springboot官方的starter
Ⅱ、XX-spring-boot-starter是第三方扩展的starter
2、 创建maven项目
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.12.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.hikvision</groupId>
<artifactId>aspectlog-spring-boot-starter</artifactId>
<version>1.0.1.RELEASE</version>
<name>aspectlog-spring-boot-starter</name>
<description>在日志中打印方法执行时间</description>
<properties>
<java.version>1.8</java.version>
<