Machine JSON Logging
March 30, 2026 ยท View on GitHub
--machine-log-json makes mydumper and myloader emit one JSON object per line to stderr or to --logfile.
This mode is intended for automation, CI jobs, watchdogs, and log shippers.
Stability
The JSON contract is versioned by:
schema_versionevent_version
Consumers should reject or explicitly handle unknown future versions.
Guaranteed Fields
Every machine-log event contains these fields:
schema_versionevent_versionseqrun_idkindtsleveltoolprogrampideventphasestatusfatal
parent_seq is also present when the current event has a causal predecessor in the same thread.
Optional Fields
These fields are emitted only when relevant:
threaddomainmessageparent_seqretryablemysql_errnoerror_codesqlstateobject_idjob_idchunk_id
Domain-specific events may also add fields such as:
dbtablefilenamepart_indexthread_idconnection_idrows_donerows_totalprogress_pcttables_totaltables_remainingduration_msexit_codetablesfilesbyteserrorswarningsretriesskipped
Unknown extra fields must be ignored by consumers.
Status Contract
Structured machine events use these statuses:
startedprogressfinishedfailedcancelledwarning
Event Types
Preferred events are domain events such as:
process_configprocess_versiondump_starteddump_completedrestore_completedrestore_sqlrestore_filechecksum_check
If a call site still uses a generic wrapper instead of a dedicated domain event, the fallback event name is:
process_noticeprocess_warningprocess_error
Those fallback events still carry the standard machine fields and may include source_api to indicate which wrapper emitted them.
Sequencing
seqis a process-wide monotonically increasing event number.parent_seqpoints to the previous causal event on the same thread when available.run_idis a UUIDv7 identifying the whole process execution.
Completion Summary
Completion events currently include:
dump_completedrestore_completed
Their counters are intended for machine use and include:
tablesfilesbyteserrorswarningsretriesskippedduration_msexit_code
Consumer Guidance
- Parse JSON lines incrementally.
- Key off
event,phase, andstatusinstead of parsingmessage. - Treat
messageas human-readable context, not as a stable machine contract. - Ignore unknown fields.
- Preserve
run_id,seq, andparent_seqwhen forwarding events downstream.