languages / elixir / configuration / capture-user-context

Elixir Configuration - Capture User Context

Capturing user context is a powerful feature that allows you to associate logs with users in your application. This is great for support as you can quickly narrow logs to a specific user, making it easy to identify user reported issues.

How to use it

Simply add the UserContext immediately after you authenticate the user:

1
2
%Timber.Contexts.UserContext{id: "my_user_id", name: "John Doe", email: "john@doe.com"}
|> Timber.add_context()

All of the UserContext attributes are optional, but at least one much be supplied.

Questions?

Chat with us, just click the talk button in the bottom right of this page.

Chat with us
Sign Up

Log better and solve problems faster, today. Install in under a minute.

Sign Up