添加日志 文档开关

This commit is contained in:
sgjj 2020-01-03 18:21:00 +08:00
parent 834cb473f5
commit 30ef12ada0
2 changed files with 31 additions and 26 deletions

View File

@ -1,5 +1,6 @@
package net.mingsoft.config; package net.mingsoft.config;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.EnableWebMvc;
@ -13,6 +14,7 @@ import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2; import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration @Configuration
@ConditionalOnProperty(prefix="ms",name = "swagger.enable", havingValue = "true")
public class SwaggerConfig { public class SwaggerConfig {
@Bean @Bean

View File

@ -6,8 +6,11 @@ server:
logging: logging:
level: level:
net.mingsoft: trace net.mingsoft: trace
file: mcms.log file: mcms.log #日志文件存放位置
path: log #日志压缩文件存放位置
ms: ms:
swagger:
enable: true #启用swagger文档
manager: manager:
path: /ms path: /ms
view-path: /WEB-INF/manager view-path: /WEB-INF/manager