Skip to content

Plain text log tail feature request #16

Open

Description

@kensmith

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.

Activity

  1. jakemalachowski commented on Jan 2, 2025

    @jakemalachowski
    Contributor

    You should be able to do this by passing in -o json to your logs command. Does this address use case?

  2. kensmith commented on Jan 2, 2025

    @kensmith
    Author

    I got what I wanted from this

    render logs -r <id> -o text --tail|cut -f 4- -d' '|./bin/pretty-jq
    

    is it possible to avoid printing the timestamp? I already have the timestamp in my slog output. That would avoid needing the cut part.

  3. davidharting commented on Sep 14, 2026

    @davidharting
    Contributor

    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?

    render logs --resources <id> --tail --output json \
        | jq --unbuffered -r '.message' \
        | ./bin/pretty-jq
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions