Replace deprecated event handlers with loggers

This change follows on from #1763.