I am writing a fork that places an access log into a file, such as a mediocre web server. The client connhas remote_ipand as the source of data peer. What should I use and what is the difference between them?
Are there any documents describing each object in conn?
In addition, my plugin is similar to the following snippets, is this natural from the point of view of the Elixir / Phoenix?
Logger.info(
Enum.join([
"type:" <> "request",
"remoteip:" <> Enum.join(Tuple.to_list(conn.remote_ip), ","),
"method:" <> conn.method,
"path:" <> conn.request_path,
"status:" <> to_string(conn.status),
"size_res:" <> to_string(byte_size(to_string(conn.resp_body))),
], ",")
)
source
share