Run custom java code as early as possible during app startup

0
I want to call Core.registerLogSubscriber() to send logged error messages to Sentry. Preferably, I want to call it before the first message is logged that is “Initializing runtime...”. The only option I know is an “After startup” microflow, but I think it starts too late. I also tried a javax.servlet.ServletContextListener implementation annotated with @javax.servlet.annotation.WebListener, but the class didn’t load (I put it in the same Eclipse project where my custom actions are). What about custom OSGI components? How hard is it to add one?  
asked
1 answers
0

We do something similar and have the setup as the first action in our After Startup microflow. I believe this is the earliest place you perform an action like this. It will be interesting to see if anyone else has a better solution.

answered