bleacherreport / plug_logger_json

Elixir Plug that formats http request logs as json
https://dev.bleacherreport.com/elixir-phoenix-centralized-http-logging-aa50efe3105b#.k00ri7og7
Apache License 2.0
132 stars 32 forks source link

Remove duplicate error logging #6

Open johnkelly opened 8 years ago

johnkelly commented 8 years ago

I haven't been able to figure out how to shut off the default non JSON error logging, so that the error is only logged in the JSON format instead of the default + JSON formats.

mizalewski commented 7 years ago

Hi! You probably don't removed plug Plug.Logger from endpoint.ex in your project (3rd step in Installation).

danmcclain commented 7 years ago

The "Running with Cowboy using " message comes from here: https://github.com/phoenixframework/phoenix/blob/master/lib/phoenix/endpoint/cowboy_handler.ex#L100

gmile commented 6 years ago

@johnkelly apart from @mizalewski's , check your Elixir Logger's log level. I had the same issue with regular logging still appearing in logs, only to realize I had :debug level logs enabled.

Make sure that:

  1. default logger is set to log only :error or :debug level,
  2. plug_logger_json is set to log on info level.