:wave: is it possible to get kratos to log with p...
# general
h
👋 is it possible to get kratos to log with prettied lines?
m
https://www.ory.sh/docs/self-hosted/operations/logging
The
level
configuration key supports the following values:
• `debug`: usually only enabled when debugging. Very verbose logging. If
json
is the log format, the JSON will be prettified for better readability.
h
It's debug and json mode. But I just get the logs as one line inside my docker container
b
not by configuration, but you can pipe it through a tool, that prettifies the logs. Haven't tried, but maybe this could work: https://github.com/blacha/pretty-json-log
h
Jonas, that would kinda be like piping the json into
jq
but that doesn't seem to work well 😕
b
but that doesn't seem to work well
can you elaborate on that? what doesn't work well?
h
@bland-eye-99092 so i'm just doing.
Copy code
$ docker compose logs kratos -f 2>&1 | jq --unbuffered --stream '.'
jq: parse error: Invalid numeric literal at line 1, column 9
Below that jq output, i just get a bunch of empty lines and then it exit. and it makes sense, because the output contains
kratos-1  | <json output>
even CORS logs is.
Copy code
kratos-1  | [cors] 2025/02/23 19:44:45 ServeHTTP: Actual request
kratos-1  | [cors] 2025/02/23 19:44:45   Actual response added headers: map[Access-Control-Allow-Credentials:[true] Access-Control-Allow-Origin:[<http://localhost:3000>] Access-Control-Expose-Headers:[Content-Type] Vary:[Origin]]