logging - Can I configure startup and shutdown logs for Spring Boot applications? -


for ability verify startup , shutdown of our spring boot applications want configure startup.log , shutdown.log capturing events bootstrap , shutdown application.

for startup to:

root webapplicationcontext: initialization completed in {x} ms 

and shutdown from:

closing org.springframework.boot.context.embedded.annotationconfigembeddedwebapplicationcontext@53bd8fca: startup date [wed aug 19 09:47:10 pdt 2015]; root of context hierarchy 

to end.

is container specific? (tomcat vs jetty vs undertow)

you can create event listener watches applicationreadyevent , contextstoppedevent , log whatever want.

@service public class foo {      @eventlistener     public onstartup(applicationreadyevent event) { ... }      @eventlistener     public onshutdown(contextstoppedevent event) { .... }  } 

Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -