[backend] Retry logging events if database is unavailable