Put app version in logs

Whenever we create a new build of our app, we currently add a build ID to our priv/static folder. From time to time, this has been helpful when debugging.

I’d like to go a step further and add application build IDs to our log output, so that when we go through log files to track down an issue, it’s easy to see which codebase was running at the time.

Customizing the format string isn’t adequate because I’d like to add new logger backends that store the data in a structured format.

I think what I’m looking for is a way to add a metadata key to all uses of Logger within the application, but I don’t know the best way to achieve that.

1 Like

Could just add a new plug to the pipeline that adds that metadata.

Though I’d think there would be somewhat to tell logger some metadata at compile-time and hold it permanently… Maybe someone else knows?