Logging best practice

Hi, I’m new on Motoko development, coming from the world of Java.
I wonder what is the best way to write a debug log and how to consult all messages if necessary ?

Debug.print("Is it possible, from the on-chain canister, to view this line later ?");

Thanks :wink:

You might consider using something like canistergeek for that:

1 Like

When developing locally, this will be printed to the replica console (the stuff you see if you run dfx start without a --background flag). On the live deployment, there’s currently no way to see your canister’s logs. For that, other tools (like the one mentioned by Paul) are necessary.

Ok ! Thanks for your answers :wink: