Skip to content

Commit aa0d736

Browse files
committed
better logging for requests (path, host, connecting IP,..)
1 parent 74d04dd commit aa0d736

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/kirei/routing/base.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,13 @@ def call(env)
6666
Kirei::Logging::Logger.call(
6767
level: Kirei::Logging::Level::INFO,
6868
label: "Request Started",
69-
meta: params,
69+
meta: {
70+
"http.method" => route.verb.serialize,
71+
"http.route" => route.path,
72+
"http.host" => env.fetch("HTTP_HOST"),
73+
"http.request_params" => params,
74+
"http.client_ip" => env.fetch("CF-Connecting-IP", env.fetch("REMOTE_ADDR")),
75+
},
7076
)
7177

7278
statsd_timing_tags = {

0 commit comments

Comments
 (0)