Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 1005 Bytes

README.md

File metadata and controls

42 lines (30 loc) · 1005 Bytes

QuietLogger

Build Status

A simple plug to suppress health check logging. Useful when running apps in Kubernetes.

Installation

The package can be installed by adding quiet_logger to your list of dependencies in mix.exs:

def deps do
  [
    {:quiet_logger, "~> 0.2.0"}
  ]
end

Once that's done you can replace Plug.Logger with Plug.QuietLogger in your endpoint.ex file and you're ready to go.

If you need to customize the request path you want to suppress logging for, you can pass it with the plug call:

plug Plug.QuietLogger, path: "/api/status"

You can also pass a list of paths to filter out, like:

plug Plug.QuietLogger, path: [ "/api/status", "/api/readiness" ]

If you want to change your logging level you can also set it the same way you would with Plug.Logger:

plug Plug.QuietLogger, log: :debug