Closed ComLock closed 5 years ago
I can log when an app is stopped using __.disposer https://xp.readthedocs.io/en/stable/developer/ssjs/main.html
But the context is always the same
{
"branch": "draft",
"repository": "cms-repo",
"authInfo": {
"principals": [
"user:system:anonymous",
"role:system.everyone"
]
}
}
main.js
var contextLib = require('/lib/xp/context');
log.info('Application ' + app.name + ' started in context ' + JSON.stringify(contextLib.get(), null, 4));
__.disposer(function() {
log.info('Application ' + app.name + ' stopped in context ' + JSON.stringify(contextLib.get(), null, 4));
});
The request log does not even say which app was started
We don't log application start either, not sure where this was coming from in your logs. I've now added logging for start, stop, install and uninstall.
At a customer the cronJob app often gets state STOPPED. I have looked trough all the access log on the 6 cluster nodes and found no entry for application stop. I think this is an important thing to log. Is it logged? Just no one has ever clicked stop? If not please add logging of an app beeing stopped, and who did it.