You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just started using Render today and I'm a fan. Super easy to set up. And, I love that your cli is written in go with all of its charmbraclety goodness. I would love to be able to just tail the raw logs to the console so that I can grep, parse, colorize, etc. using my own scripts. For example, in dev, I use this jq monstrosity to colorize the logs:
#!/usr/bin/env bash
highlight=
if [[ "$1" != "" ]]
then
highlight="$1"
fi
jq --unbuffered -r -R -M 'fromjson? | .' \
| awk -v highlight="$highlight" 'BEGIN {IGNORECASE=1} { \
if ($0 ~ /msg/) { \
line = $0; \
if (highlight != "") { \
gsub(highlight,"\033[1;33m" highlight "\033[0m", line); \
} \
print "\033[1;32m" line "\033[0m"; \
} else { \
line = $0; \
gsub(/INFO/,"\033[1;32mINFO\033[0m", line); \
gsub(/WARN/,"\033[1;33mWARN\033[0m", line); \
gsub(/ERROR/,"\033[1;31mERROR\033[0m", line); \
if (highlight != "") { \
gsub(highlight,"\033[1;33m" highlight "\033[0m", line); \
} \
print line \
} \
}'
It'd be dreamy if I could do something like
render logs -f | ./bin/pretty-jq
and get the familiar log view that I enjoy when running locally.
If your log messages are JSON formatted then the using --output json should put your app's entire JSON log (serialized to string) inside of the .message field.
So I'm wondering if this would give you what you want?
Activity
jakemalachowski commentedon Jan 2, 2025
You should be able to do this by passing in
-o jsonto your logs command. Does this address use case?kensmith commentedon Jan 2, 2025
I got what I wanted from this
is it possible to avoid printing the timestamp? I already have the timestamp in my slog output. That would avoid needing the cut part.
davidharting commentedon Sep 14, 2026
If your log messages are JSON formatted then the using
--output jsonshould put your app's entire JSON log (serialized to string) inside of the.messagefield.So I'm wondering if this would give you what you want?