Filter sensitive info(passowrd) in cowboy logs.

Hello,
is there a way to filter sensitive info for cowboy logs? For example if cowboy crashes due to missing function clause. E.g.:
[error] #PID<0.684.0> running Example.Endpoint (connection #PID<0.683.0>, stream id 1) terminated
fallback_controller.ex:9: fallbackController.call(%Plug.Conn{adapter: {Plug.Cowboy.Conn, :…}, assigns: %{}, body_params: %{…, “password” => “asdfasdf”, …}, cookies: %{}, halted: false, host: “eraptor.elis.tech”, method: “POST”, owner: #PID<0.12916.42>.
Michal

Hello and welcome!

Take a look here. TL;DR, add redact: true to the appropriate fields.

I do not think it will work. Error is logged before Ecto.Changset is created. My understanding is that connection is logged, and connection can contain sensitive information. I was hoping something like
config :phoenix, :filter_parameters, [“password”, “secret”] would also work for this kind of errors (or there would be similar possibility for cowboy at least for production).
Michal

Ohhhhh sorry, my bad. I was sort of on autopilot on that answer :grimacing:

Are you using Phoenix? You can filter parameters with Phoenix.Logger.

Yes I am using Phoenix. Filtering works fine for debug logs, password is filtered. But when cowboy process crashes, it does not work.
Michal