How can we enable and view logs? #3337
Replies: 5 comments
-
Is your device a leaf device that is communicating via IoT Edge? If yes, then the instructions here for enabling logging should work for you: https://github.com/Azure/azure-iot-sdk-csharp/tree/main/tools/CaptureLogs |
Beta Was this translation helpful? Give feedback.
-
There are technically no downstream nodes, and I don't think IoT Edge devices are typically thought of as leave nodes; maybe I misunderstood. This device is the IoT Edge with no downstream devices. I can try the suggestion to see if it works in this case too. |
Beta Was this translation helpful? Give feedback.
-
The above instructions for enabling logs should work for any environment that the library is used in. However, someone from the IoT Edge team might be able to comment on if that's the most efficient way of logging for IoT Edge or not (https://github.com/Azure/iotedge) |
Beta Was this translation helpful? Give feedback.
-
I think what I want to do is enable console logging as described in the link you provided, but it says I have to add a ConsoleEventListener.cs file to the project. I want to be able to see these logs on the running & deployed IoT Edge. Specifically, I'm expecting these logs to originate from the $edgeAgent and $edgeHub containers. Are you suggesting that I need to build the containers from scratch, include a custom EventListener object, and redeploy the manifest? The device isn't properly initializing and connecting to IoT Hub, so I can't see logs in the troubleshooting panel in Azure's portal. I have shell access to the device, and I was trying to go through the systemd journal to find the logs, but they don't appear to be enabled. Is there really no environment variable or setting I can change to make these events log to console? |
Beta Was this translation helpful? Give feedback.
-
The IoT Edge dependency takes it a bit out of my depth to be able to recommend the best solution for you. I'm tagging a member of the IoT Edge team, who can hopefully assist you better. @varunpuranik FYI |
Beta Was this translation helpful? Give feedback.
-
I'm facing some issues getting an IoT Edge working with a complicated proxy configuration.
I want to know if it is possible to enable logging and specifically see if the following line is logged:
azure-iot-sdk-csharp/iothub/device/src/Transport/AmqpIot/AmqpIotTransport.cs
Line 187 in 2802fa2
Most of the code appears to have
Logging.Info
calls surrounded by aLogging.IsEnabled
check. I enabled debug output logging on the IoT Edge, but I don't see these messages. How can I enable logging, and where would I expect to see the output?Beta Was this translation helpful? Give feedback.
All reactions