Execute operations on application destroy event

System Information
  • Strapi Version: v4
  • Operating System: Windows
  • Database: MySQL
  • Node Version: 16.11.0
  • NPM Version: 8.0.0
  • Yarn Version: 1.22.18

I simply want to produce some log on my Strapi application startup and shutdown events (i.e. Docker container started and stopped).

The asynchronous lifecycle function register() in ‘./src/index.js’ suits my needs. According to the documentation I expected the same for the method destroy() but it is not invoked when the application stops.

Do you have any suggestion about how to execute some operations like producing some logs on shutdown?