# spring-log **Repository Path**: xujieyang/spring-log ## Basic Information - **Project Name**: spring-log - **Description**: 基于spring的aop实现log注解 - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2016-03-02 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #spring-log spring-log 1.0是基于spring aop实现的注解式的日志插件,类似于spring的异步注解 ## 使用方法 1 xml定义,即开启日志注解功能 ```xml ``` 2 日志注解说明 ```java @Target({ElementType.METHOD, ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface Log { /** key */ String key() default ""; /** 日志描述 */ String desc() default ""; /** 日志处理器 */ String logProcessor() default ""; } ``` 3 在需要插入日志的服务上加上日志注解 ```java @Component("logService") public class LogService { @Log public String log1() { System.out.println("logService->log1"); return "logService->log1"; } public void log2() { System.out.println("logService->log2"); } } ```