Skip to content
Discussion options

You must be logged in to vote

Thanks for raising this. Wide events as a deliberate pattern aren't mentioned anywhere in the LogTape docs, and there's no dedicated API for them today. I think it's fair to say LogTape can express wide events, but doesn't support them natively in the way evlog does.

Today the closest fit is a combination of pieces.

Logger.with({...}) returns a child logger with bound properties. It's immutable, so accumulating fields means reassigning:

let log = getLogger(["api", "checkout"]).with({ requestId });
log = log.with({ user: { id: 1, plan: "pro" } });
log = log.with({ cart: { items: 3, total: 9999 } });
log.info("Checkout completed");

withContext() does the same thing across async boundaries via

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@hanneswidrig
Comment options

@dahlia
Comment options

Answer selected by hanneswidrig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants