time_log v0.1.1 TimeLog.PreLogPlug

This plug logs the incoming requests. It logs the IP address and has the ability to anonymize the IP address if set in config. Allows calls to get_ip from other apps too.

Link to this section Summary

Functions

Returns the IP address in a Format fit for logging. If set in config the IP addresses retourned are anonymized by replacing the last digits with ‘XXX’. Requests that use internal (e.g. company) Ip addresses can be filtered if set in config(config :time_log, internal_ips: ["127.0.0.1"])

Logs the request including the IP address

Link to this section Functions

Link to this function call(conn, opts)
Link to this function get_ip(conn)
get_ip(Plug.Conn) :: String

Returns the IP address in a Format fit for logging. If set in config the IP addresses retourned are anonymized by replacing the last digits with ‘XXX’. Requests that use internal (e.g. company) Ip addresses can be filtered if set in config(config :time_log, internal_ips: ["127.0.0.1"]).

Link to this function log_request(conn)
log_request(Plug.Conn) :: Plug.Conn

Logs the request including the IP address