Skip to content

Importer logging should make wider use of context fields

Context

Currently, the importer mostly instantiates new instances of the logger per function to write log messages. Used as a command line utility, this isn't a cause for concern, as logs messages from the importer will be linear and collocated next to each other. However, when used via the API these logs will be comingled with other log entries and would benefit from the injection of correlation IDs, instance IDs, and other high-level tracking fields.

Proposal

Review logger instantiations throughout the importer code, and adapt them to use the log.WithContext option to include fields from the context.

Concerns

Since the loggers are all presently independent, and the importer composes many smaller functions together, care should be taken not to pollute the context with logging fields that are not globally relevant.

Edited by Hayley Swimelar