ajvondrak / remote_ip

A plug to rewrite the Plug.Conn's remote_ip based on forwarding headers.
MIT License
252 stars 31 forks source link

Add support of Logger.metadata #22

Closed c4710n closed 3 years ago

c4710n commented 4 years ago

Plug.RequestId supports print request_id to console with following setting:

config :logger, :console, metadata: [:request_id]

Reference: https://github.com/elixir-plug/plug/blob/3193ab3a8e1973e2fcc37b33417724a45dac857c/lib/plug/request_id.ex#L11

It would be nice if remote_ip support this feature, too:

config :logger, :console, metadata: [:request_id, :remote_ip]

So, here is it. ;)

ajvondrak commented 3 years ago

Excellent idea! Thanks for the contribution.