Importers: standardise file logging
Existing behaviour
-
Gitlab::Import::Logger
inherits fromGitlab::JsonLogger to log JSON to
importer.log`. - These loggers inherit from
Gitlab::Import::Logger
and only set the importer name:Gitlab::GithubImport::Logger
Gitlab::BitbucketImport::Logger
Gitlab::BitbucketServerImport::Logger
- These loggers inherit from
Gitlab::Import::Logger
and add significant functionality:-
BulkImports::Logger
: Addswith_entity
andwith_tracker
to build JSON payload based on current import.
-
- The following importers reference
Gitlab::Import::Logger
directly:Gitlab::JiraImport
- The following importers don't seem to do significant file logging:
Gitlab::FogbugzImport
Gitlab::GithubGistsImport
Gitlab::LegacyGithubImport
Proposal
Import::Framework::Logger
will be responsible for all file logging behavior across our importers.
- It logs JSON to an output file.
- It raises an error in development if key identifiers are missing.1
Since most of our logging behaviour is covered by Gitlab::Import::Logger
, I think our approach to file-based logging is already pretty well standardised.
Edited by James Nutt