Logging should be moved to the specific event handlers to avoid unnecessarily logging all incoming messages.