Skip to content

Instantly share code, notes, and snippets.

@monkey-codes
Created August 8, 2016 04:55
Show Gist options
  • Save monkey-codes/208866eff3ea05c000cdece28389dcab to your computer and use it in GitHub Desktop.
Save monkey-codes/208866eff3ea05c000cdece28389dcab to your computer and use it in GitHub Desktop.
@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