Why am I not able to see output of any of the "fmt.Println" or "fmt.Printf" statements specified in the chaincode in the logs even when the logging level is set to "DEBUG"?
I am using pre-built docker images to start a hyperledger node in Ubuntu.
Why am I not able to see output of any of the "fmt.Println" or "fmt.Printf" statements specified in the chaincode in the logs even when the logging level is set to "DEBUG"?
I am using pre-built docker images to start a hyperledger node in Ubuntu.
Most likely that is happening because you are trying to find your messages in a log stream which is generated by peer server. But chaincode is executed in independent docker container and has it's own log stream.
In order to get an access to the chaincode's logs, on the same server where peer
process is started, right after chaincode is deployed:
Tun command docker ps
. The output should looks like:
77636df123e3 dev-jdoe-1edd7(...YOUR CHAINCODE ID)
Then attach to docker container where your chaincode is exectued using
docker attach 77636df123e3
Execute any of your chaincode's methods and check if log messages appears in this stream
some things like this:
docker logs dev-peer1.org2.example.com-mycc-1.0