1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- package com.ym;
- import lombok.extern.slf4j.Slf4j;
- import org.mybatis.spring.annotation.MapperScan;
- import org.springframework.boot.SpringApplication;
- import org.springframework.boot.autoconfigure.SpringBootApplication;
- import org.springframework.boot.logging.LogLevel;
- import org.springframework.boot.logging.LoggingSystem;
- import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
- import org.springframework.cloud.client.loadbalancer.LoadBalanced;
- import org.springframework.cloud.openfeign.EnableFeignClients;
- import org.springframework.context.annotation.Bean;
- import org.springframework.context.annotation.ComponentScan;
- import org.springframework.context.annotation.Configuration;
- import org.springframework.context.annotation.EnableAspectJAutoProxy;
- import org.springframework.scheduling.annotation.EnableAsync;
- import org.springframework.scheduling.annotation.EnableScheduling;
- import org.springframework.web.client.RestTemplate;
- @EnableAspectJAutoProxy
- @Slf4j
- @SpringBootApplication
- @EnableFeignClients("com.ym.mec")
- @MapperScan(basePackages = {"com.ym.mec.biz.dal.dao", "com.ym.mec.biz.dal.mapper"})
- @ComponentScan(basePackages = {"com.ym", "com.mec.redisson", "com.yonge.log"})
- @EnableScheduling
- @EnableDiscoveryClient
- @Configuration
- @EnableAsync
- public class SealClassApplication {
- public static void main(String[] args) {
- SpringApplication.run(SealClassApplication.class, args);
- configureGlobalLogger();
- log.info("SealClassApplication started");
- }
- private static void configureGlobalLogger() {
- LoggingSystem loggingSystem = LoggingSystem.get(ClassLoader.getSystemClassLoader());
- // 设置业务日志记录器的日志级别为INFO
- loggingSystem.setLogLevel("businessLogger", LogLevel.INFO);
- }
- @Bean
- @LoadBalanced
- public RestTemplate restTemplate(){
- return new RestTemplate();
- }
- }
|