[BUGFIX] Avoid DB error on writing to log