ChrisW
ChrisW

Reputation: 56123

How to log progress in Corda?

https://docs.corda.net/docs/corda-os/4.5/flow-state-machines.html#progress-tracking talks about how to use the ProgressTracker API but doesn't say how to view its output.

I gather its output is written to the terminal when a flow is started from the CRaSH shell.

Can it be configured to be written anywhere else, e.g. to a node's log file?

Or is this only ever visible on the client side, e.g. using the startTrackedFlowDynamic API like in this answer:

val flowHandle = proxy.startTrackedFlowDynamic(MyFlow::class.java, arg1, arg2, ...)

flowHandle.progress.subscribe { progressTrackerLabel ->
    // Log the progress tracker label.
}

Writing and maintaining other (non-Corda) server-side code, I've been used to using log files. Is it conventional to use log messages when writing CorDapps, i.e. to write code which logs a CorDapp's routine progress and any exceptional events?

Upvotes: 1

Views: 297

Answers (1)

Ashutosh Meher
Ashutosh Meher

Reputation: 1841

The ProgressTracker is supposed to provide information to a client side regarding the progress of a particular flow.

Its always good to have logging in your Cordapps. I don't think there is any specific configuration to dump to ProgressTracker steps to a log file, but you could always have log statements to do the same.

Upvotes: 1

Related Questions