Improve logs when exporting projects using Import/Export

Problem to solve

It's quite difficult to debug failed project exports when using Import/Export because the logs don't contain relevant information and the exception message sometimes aren't meaningful and don't have context.

Proposal

Log more information when exporting projects and improve the exception messages

Ideas

Log progress of the export

  • Log a message when starting to export each component of the tarball. For example: Version export started, Project tree export started, Repository export started
  • For the Project tree export, log when the export of each relation started. For example: Project tree: project attributes export started, Project tree: issues export started`
  • Log how many records will be exported. Number of issues to export: 10, Number of LFS objects to export: 10
  • Log the size or statistics of the project at the beginning of the export

When an exception occurs

  • Log which record failed. For example: Failed to export issue 10 of 100. Issue ID #15
  • Log the full exception message without filtering it.. Exceptions are already logged. But they are logged with the attribute exportable_id.

Kibana KLQ: json.extra.exportable_id : * AND json.severity : "ERROR"

Edited by Rodrigo Tomonari