Hello @Kiran Pradeep ,
Please check the article on Best Practices for high-level applications - Error handling and logging
For your case, where you want to analyse long running application on Azure Sphere without attaching the debugger the best and recommended approach is to send the value of the errno variable through D2C messages to an IoT Hub.
===UPDATE====
Alternatively you can capture/redirect the output stream to a file:
https://learn.microsoft.com/en-us/azure-sphere/app-development/manual-build#debug-the-application
You don’t actually need to use gdb/debugger to access this output stream from a connected device. A terminal client reading that stream can save/redirect their output to file.
Remember:
- Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.
- Want a reminder to come back and check responses? Here is how to subscribe to a notification.