axiomhq/next-axiom

How do I configure the log fields and values?

travistylervii opened this issue · 1 comments

How do I add, remove and configure field values when logging?

I would like to change the platform source to "Back-end" and add a path field.

CleanShot 2023-06-21 at 16 30 47@2x

bahlo commented

Hi @travistylervii, you cannot override the platform values at the moment.

I recommend using your own field for that, you can attach fields to a logger like this:

const log = req.log.with({ source: 'back-end' });

It will then show up as fields.source.

Please reopen this issue if this doesn't solve this to your satisfaction.