Canister Logging Support [Community Consideration]

I’m running on-chain testing for the Motoko Bootcamp ( - I essentially perform inter-canister calls on submitted projects by students. Occasionally, when students modify the interface or send unexpected types, my canister trap.Having access to this call_on_cleanup would have been great to handle those cases.

I’ve found some workaround (checking the Candid interfaces in advance through the frontend and WASM metadata, as well as isolating tests in a separate canister and using try/catch) so it’s not an important item for me anymore.

Hey it seems dfx 0.18.0 has some sort of log reading functionality? Can we get an update?

It’s unfortunately not working yet because there was a mixup in the type of call used when dfx is trying to retrieve logs. That’s why we didn’t advertise it yet. We’ll get it fixed in the next dfx version and there’s also going to be a presentation/demo in one of the following weeks global R&D meetings.

Stay tuned, we’ll give you updates and make more noise once it’s available in dfx for beta testing! We’re definitely going to need you guys to test it out and give us feeback!


Good news, everyone!
The first canister logging implementation is now available in dfx 0.19.0 release.
Please try it out and let us know about your experience!



Thanks for all the hard work.

Is the logging enabled on all subnets? Because I get Failed to query call function 'fetch_canister_logs' regarding canister 'xcgns-iqaaa-aaaae-aai7a-cai'. Query call (without wallet) failed. The replica returned a rejection error: reject code CanisterError, reject message IC0504: fetch_canister_logs API is not enabled on this subnet, error code Some("IC0504")


Hi Gabriel.
Canister logging is not enabled on mainnet subnets yet.
We wanted to make it available locally in DFX first.
There is no firm ETA on rolling out this feature on mainnet subnets. We would like to see the first feedback on local DFX to see if canister developers are happy with the current look and feel before rolling out it to mainnet.