Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@SpringBootApplication
class CloudwatchLoggingApplication {
@Bean
EmbeddedServletContainerFactory servletContainer(TomcatContextCustomizer customizer) {
def factory = new TomcatEmbeddedServletContainerFactory()
factory.setTomcatContextCustomizers([customizer])
factory
}
@Bean
TomcatContextCustomizer contextCustomizer(){
new TomcatContextCustomizer() {
@Override
void customize(Context context) {
context.getPipeline().addValve(new LogbackValve())
}
}
}
static void main(String[] args) {
SpringApplication.run CloudwatchLoggingApplication, args
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment