How do I configure the default logging settings for AWS IoT Core?
5 minute read
I want to configure the default logging settings for AWS IoT logs in AWS IoT Core to reduce both costs and data traffic.
Note: This article relates to only V2 of AWS IoT Core logs.
It's a best practice to set default logging to a low verbosity level for your AWS IoT Core and configure resource-specific logging to a higher verbosity level. Log verbosity levels include DISABLED (lowest), ERROR, WARN, INFO, and DEBUG (highest).
Important: Depending on your AWS IoT Core fleet size, turning on more verbose log levels can incur high costs and make troubleshooting more difficult. Turning on more verbose log levels also creates higher data traffic. It's a best practice to use INFO or DEBUG only as a temporary measure when troubleshooting. After troubleshooting is complete, reset logging levels back to a less verbose setting.
Make sure that you have the AWS Command Line Interface (AWS CLI) installed locally with IoT admin permission credentials. The default AWS Region for AWS CLI must point towards the targeted AWS Region. You must have clients connected to and interacting with your AWS IoT Core endpoints, either as registered or non-registered IoT things.
Note: If there isn't an IAM role configured, then AWS IoT Core can't send logs to Amazon CloudWatch and this feature isn't available for you to use.
3. Set AWS IoT Core default logging to one of the less verbose logging levels such as ERROR or WARN. This can be done using the AWS IoT console or AWS CLI:
Note: If you are troubleshooting an issue and don't have specific client attributes, then you can temporarily set the default logging level to DEBUG. Setting the level to DEBUG generates significant costs and data traffic, depending on the fleet size and the duration that it spent at this level.