Skip to main content

Logging

Log files

Mina logs are stored in ~/.mina-config/:

FileDescriptionSize limitRotation
mina.logMain daemon logs10 MiB50 files (mina.log.0 .. mina.log.50)
mina-best-tip.logBest tip logs (useful for hard fork analysis)5 MiB1 file
mina-prover.logProver memory usage and batch sizes128 MiB1 file
mina-verifier.logVerifier memory usage and batch sizes128 MiB1 file

Following logs

Depending on how you started the daemon:

# Docker
docker logs --follow mina-node

# Systemd
journalctl --user -u mina -n 1000 -f

# Direct
tail -f ~/.mina-config/mina.log

Log levels

The Mina daemon supports the following log levels, from most to least verbose:

  1. Spam
  2. Trace
  3. Debug
  4. Info (default for stdout)
  5. Warn
  6. Error
  7. Fatal

Setting a level filters out all messages below it. For example, Info shows only Info, Warn, Error, and Fatal messages.

Log format

By default, logs are output as plain text. When -log-json is enabled, logs use the following JSON structure:

{
"timestamp": "2020-12-23 21:25:04.616526Z",
"level": "Error",
"source": {
"module": "Transition_router",
"location": "File \"src/lib/transition_router/transition_router.ml\", line 231, characters 12-24"
},
"message": "Failed to find any peers during initialization (crashing because this is not a seed node)",
"metadata": {
"host": "1.1.1.2",
"peer_id": "12D3KooWGQSPgo7ypy9717D3Vgz2RHaqB2ndDRHEFcAfJDAv284q",
"pid": 12,
"port": 8302
}
}

Daemon logging options

Set these flags when starting the daemon:

FlagDefaultDescription
-log-levelInfoLog level for stdout
-file-log-levelTraceLog level for log files
-log-jsonoffOutput logs as JSON instead of plain text
-log-block-creationtrueLog steps for including transactions and SNARK work in a block
-log-received-blocksfalseLog blocks received from peers
-log-snark-work-gossipfalseLog snark-pool diffs received from peers
-log-txn-pool-gossipfalseLog transaction-pool diffs received from peers
-log-precomputed-blocksfalseInclude precomputed blocks in logs

Exporting logs

From a running node

mina client export-logs -tarfile <FILENAME>

Compresses available logs into a .tar.gz archive in ~/.mina-config/exported_logs/. The -tarfile flag is optional and defaults to the current date-time.

Logs can also be exported via GraphQL using the exportLogs mutation.

From a stopped node

mina client export-local-logs -tarfile <FILENAME>

Same behavior, but works without a running daemon.

Crash reports

If the daemon crashes, it generates a crash report in ~/.mina-config/. Only the latest report is retained, named with the crash date-time.

A crash report may contain:

FileDescription
crash_summary.jsonSystem info, version, and final log output
mina_status.jsonOutput of mina client status at time of crash
mina_short.logLast 4 MB of mina.log
registered_mask.dotLatest ledger visualization
frontier.dotLatest frontier visualization
daemon.jsonDaemon configuration file

You can upload crash reports and exported logs directly to a GitHub issue to help with debugging.