org.zodiac.autoconfigure.log.PlatformLogPublisherServletAutoConfiguration Maven / Gradle / Ivy
package org.zodiac.autoconfigure.log;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
import org.springframework.context.annotation.Bean;
import org.zodiac.autoconfigure.log.condition.ConditionalOnPatformLogRequestEnabled;
import org.zodiac.autoconfigure.security.http.servlet.SecurityHttpServletAutoConfiguration;
@SpringBootConfiguration
@ConditionalOnPatformLogRequestEnabled
@ConditionalOnWebApplication(type = Type.SERVLET)
@AutoConfigureAfter(value = SecurityHttpServletAutoConfiguration.class)
//@AutoConfigureBefore(value = {PlatformLogToolAutoConfiguration.class})
@ConditionalOnClass(value = {org.zodiac.log.LogOperations.class, javax.servlet.Servlet.class, org.springframework.web.servlet.DispatcherServlet.class})
public class PlatformLogPublisherServletAutoConfiguration {
public PlatformLogPublisherServletAutoConfiguration() {
super();
}
@Bean
@ConditionalOnMissingBean(value = {org.zodiac.log.publisher.ApiLogPublisher.class})
protected org.zodiac.log.publisher.ApiLogPublisher apiLogPublisher() {
return new org.zodiac.log.publisher.ServletApiLogApplicationPublisher();
}
@Bean
@ConditionalOnMissingBean(value = {org.zodiac.log.publisher.ErrorLogPublisher.class})
protected org.zodiac.log.publisher.ErrorLogPublisher errorLogPublisher() {
return new org.zodiac.log.publisher.ServletErrorLogApplicationPublisher();
}
@Bean
@ConditionalOnMissingBean(value = {org.zodiac.log.publisher.UsualLogPublisher.class})
protected org.zodiac.log.publisher.UsualLogPublisher usualLogPublisher() {
return new org.zodiac.log.publisher.ServletUsualLogApplicationPublisher();
}
}