MiravoMiravo

Logging

Set Miravo log levels, switch between pretty and JSON logs, and stream factory events by channel.

Miravo writes its logs to stderr. Command results, such as tables, summaries, and --json output, go to stdout. That split lets you pipe results to jq while logs still reach your terminal or container log collector.

Levels

LevelSwitchWhat shows up
debug--log-level debug or --verboseTick details, adapter internals, and startup traces
infoDefaultStartup, shutdown, state changes, periodic summaries
warn--log-level warnWarnings and errors
error--log-level error or --quietErrors

Precedence is --quiet, then --log-level, then --verbose. --log-level, --verbose, and --log-format are start flags. NO_COLOR removes ANSI styling. So does --plain, which also keeps the text layout stable.

Output format

Each line has an optional level word, the source, and the message.

start Engine: Starting Miravo...
success Engine: Factory started.
Engine: 5s · 1.0 ticks/s · 0 data points
miravo start --log-level info

Event streaming

miravo logs is separate from the process log. It reads fault, lifecycle, asset, engine, and adapter events from a running factory. The engine channel carries state changes and engine:error events (context, message, optional fix), so a non-zero core.engineErrorsCount in /api/metrics always has a matching line. Tick overruns are warnings in the process log, not engine:error events.

CommandResult
miravo logsStream all channels except tick
miravo logs --tail 50Print the last 50 events, then stream
miravo logs --no-followPrint the last 50 events and exit
miravo logs --channels faults,lifecycleStream only the selected channels
miravo logs --jsonEmit NDJSON on stdout

With --json, each line is {"source":"history"|"live","event":{...}}. Both carry the same type-discriminated event, such as {"type":"fault:triggered","assetId":"pump-001","fault":"cavitation"}. Asset events always use assetId. History events also include id, tick, simulationTime, and timestamp; live events do not.

miravo logs --channels faults --json | jq -c '.event'

Reference

Switch or env varEffect
--log-level <level>debug, info, warn, or error
-v, --verboseShorthand for --log-level debug
-q, --quietErrors only
--log-format jsonStructured JSON lines
--plainPlain text, no ANSI styling
NO_COLOR=1No ANSI styling in pretty output
MIRAVO_DEBUG=1 or --debugStack traces for unexpected failures

Next

Was this page useful?

Last updated on