packages/api-server/src/logFormatter/README.md
LogFormatter is a utility that formats RedwoodJS Logger output in development.
It is based on pino-colada: a cute ndjson formatter for pino.
Redwood-specific GraphQL log data included by the the useRedwoodLogger envelop plug-in is supported:
Pipe logs to the formatter:
Example:
echo "{\"level\": 30, \"message\": \"Hello RedwoodJS\"}" | yarn rw-log-formatter
Output:
11:00:28 š² Hello RedwoodJS
⨠Done in 0.14s.
Log formatting is automatically setup in the yarn rw dev command.
Pipe logs to the formatter with rw serve:
yarn rw dev
yarn rw serve | yarn rw-log-formatter
yarn rw serve api | yarn rw-log-formatter
Note: Since rw serve sets the Node environment to production you will not see log non-warn/error output unless you configure your logging level to debug or below.