Debugging emissary
Running with debug info
When running emissary for development purposes, using cargo run --profile testnet is recommended. The testnet profile enables optimizations, debug assertions and overflow checks.
Prometheus and Grafana
The metrics feature must be enabled for emissary-util. To run emissary-cli with the debug profile and metrics, use:
cargo run \
--profile testnet \
--no-default-features \
--features=metrics \
-- \
--metrics-server-port 7799Start Prometheus:
prometheus --config.file resources/prometheus.ymlresources/dashboard.json contains the JSON Model for a router dashboard which can be exported to Grafana:

Logging
There are 5 logging levels, ordered by increasing verbosity: ERROR, WARN, INFO, DEBUG and TRACE.
Each subsystem in emissary has a logging target which allows enabling, disabling and adjusting the logging level of that subsystem individually. It's possible to, e.g., enable TRACE for SSU2, disable logging for NTCP2 entirely and set the logging level of the tunnel subsystem to DEBUG.
By default, INFO is enabled for all logging targets.
Examples
Enable full trace logging for all subsystems:
emissary-cli -lemissary=traceSet default logging level to WARN, enable DEBUG for the tunnel subsystem and TRACE for NTCP2 and SSU2:
emissary-cli -lemissary=warn,emissary::tunnel=debug,emissary::ntcp2,emissary::ssu2=traceEnable TRACE for transit tunnels and turn off tunnel pool-related logging:
emissary-cli -lemissary::tunnel::transit=trace,emissary::tunnel::pool=offemissary has support for three logging presets which are just a shorthand for enabling/disabling several subsystems. All these turn off logging for emissary::tunnel::pool.
i2cp- enable
TRACEfor all I2CP-related subsystems
- enable
sam- enable
TRACEfor all SAM-related subsystems, includingyosemite
- enable
transit- enable
TRACEfor transit tunnels andDEBUGfor transport manager
- enable
Start emissary with full TRACE-level logging for SAM and related subsystems:
emissary-cli -lsamAll logging targets can be found with:
grep -R --exclude-dir={.git,target,docs,examples} "const LOG_TARGET" .