Add logging to onAlert handler.