Skip to content

An Elixir Logger replacement that suppresses health check endpoints

License

Notifications You must be signed in to change notification settings

Driftrock/quiet_logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

An Elixir Logger replacement that suppresses health check endpoints

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages