1

I'm very new with Azure and IoT Edge, and I'm trying to understand how modules works.

I followed this good tutorial (https://learn.microsoft.com/en-us/azure/iot-edge/tutorial-c-module) and everything seems to run properly.

My question is about the printf that are in the code. (for example on the point 3 of here : https://learn.microsoft.com/en-us/azure/iot-edge/tutorial-c-module#update-the-module-with-custom-code)

if (NULL == messageInstance)
{
    printf("Failed allocating 'MESSAGE_INSTANCE' for pipelined message\r\n");
}

Where are the output printed ?

Normally it would be on the standard output, but my module is running in background on a virtual machine. Obviously I have access to this VM. How can I see it ?

It would be great for me, in order to have a better understanding of how modules work and communicate together and with the IoT Hub.

Thanks for helping me

iAmoric
  • 1,787
  • 3
  • 31
  • 64

1 Answers1

5

The output is written to the modules logfile. You can inspect it by logging into your virtual machine using ssh and then using the following command:

sudo iotedge logs <yourModuleName>

Adding the -f option makes it follow new output and with --tail you can limit the output to the last lines of the logfile.

sudo iotedge logs <yourModuleName> -f --tail 100

displays the last 100 lines of the logfile and adds new output coming in.

René
  • 3,413
  • 2
  • 20
  • 34