Skip to content
An Elixir Logger backend for GELF
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.formatter.exs Add formatter Jun 5, 2018

GelfLogger Build Status

A logger backend that will generate Graylog Extended Log Format messages. The current version only supports UDP messages.


In the config.exs, add gelf_logger as a backend like this:

config :logger,
  backends: [:console, {Logger.Backends.Gelf, :gelf_logger}]

In addition, you'll need to pass in some configuration items to the backend itself:

config :logger, :gelf_logger,
  host: "",
  port: 12201,
  format: "$message",
  application: "myapp",
  compression: :gzip, # Defaults to :gzip, also accepts :zlib or :raw
  metadata: [:request_id, :function, :module, :file, :line],
  hostname: "hostname-override",
  format: {Module, :function} # or format: "[$level] $message"
  tags: [
    list: "of",
    extra: "tags"

In addition to the backend configuration, you might want to check the Logger configuration for other options that might be important for your particular environment. In particular, modifying the :utc_log setting might be necessary depending on your server configuration. This backend supports metadata: :all.


Just use Logger as normal.


  • Tests
  • TCP Support
  • Options for compression (none, zlib)
  • Send timestamp instead of relying on the Graylog server to set it
  • Find a better way of pulling the hostname

And probably many more. This is only out here because it might be useful to someone in its current state. Pull requests are always welcome.


Credit where credit is due, this would not exist without protofy/erl_graylog_sender.

You can’t perform that action at this time.