languages / elixir / integrations / plug

Elixir Integrations - Plug

The Timber for Elixir Phoenix integration structures and enhances your Phoenix logs automatically.

  1. Structured data
  2. What you can do
  3. Installation
  4. Disable

Structured data

You'll Get
context.http
context.session
event.http_request
event.http_response

What you can do

  1. Trace HTTP requests
  2. Inspect HTTP requests & their parameters
  3. Inspect Plug logs and view their associated metadata
  4. Search on Plug structured data
  5. Alert on Plug structured data

Installation

⚠ It is highly recommend to use the installer, it will install this integration automatically.

  1. In your endpoint.ex file insert the Timber plugs:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    defmodule MyApp.Endpoint do
      # ...
    
    - plug Plug.Logger
    
      # ...
    
    + plug Timber.Integrations.SessionContextPlug
    + plug Timber.Integrations.HTTPContextPlug
    + plug Timber.Integrations.EventPlug
    
      # The Timber should come *directly* before your app's
      # Router plug
      plug MyApp.Router
    end
    

Disable

Disabling the Plug integration is as simple as skipping or reversing the above installation instructions. In the rare event that you'd like to disable Plug logs entirely, simply remove the plug Plug.Logger in your endpoint.ex file.

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