Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Longer request logging #139

Merged
merged 4 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/triangulum/handler.clj
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
(let [{:keys [uri request-method params]} request
private-request-keys (or (get-config :server :private-request-keys)
#{:password :passwordConfirmation})
param-str (pr-str (apply dissoc params private-request-keys))]
param-str (binding [*print-length* -1] (print-str (apply dissoc params private-request-keys)))]
(log-str "Request(" (name request-method) "): \"" uri "\" " param-str)
(handler request))))

Expand Down
2 changes: 1 addition & 1 deletion src/triangulum/logging.clj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
:or {newline? true pprint? false force-stdout? false truncate? true}}]
(let [timestamp (.format (SimpleDateFormat. "MM/dd HH:mm:ss") (Date.))
log-filename (str (.format (SimpleDateFormat. "YYYY-MM-dd") (Date.)) ".log")
max-data (if truncate? (max-length data 500) data)
max-data (if truncate? (max-length data 2000) data)
line (str timestamp
" "
(if pprint? (with-out-str (pp/pprint data)) max-data)
Expand Down
Loading