- Newest
- Most votes
- Most comments
Unfortunately, it's not possible to completely remove the additional logging information added by AWS IoT Greengrass for Lambda function components. The Greengrass service automatically adds certain metadata to the log entries for context and easier troubleshooting.
However, you can customize the logging behavior to some extent:
-
Log Level: You can configure the minimum log level that Greengrass writes to file system logs. This allows you to control the verbosity of the logs, potentially reducing some of the additional information.
-
JSON Structured Logging: While not removing the Greengrass-added information, you could consider using JSON structured logging in your Lambda function. This would make it easier to parse and extract just your application's log messages programmatically if needed.
-
Custom Logging: Instead of using standard output/error streams, you could implement a custom logging mechanism in your component that writes logs to a separate file. This would give you full control over the log format, but you'd need to manage log rotation and other aspects yourself.
-
Log Manager Configuration: You can configure the log manager component to customize some aspects of logging, such as the maximum disk space for each log and the minimum log level written to CloudWatch Logs.
While these options don't completely remove the Greengrass-added information, they provide some level of customization for your logging needs. If you absolutely need raw application logs without any additions, you might need to consider alternative logging strategies within your application code.
Sources
Monitor AWS IoT Greengrass logs - AWS IoT Greengrass
JSON Structured Logging for .NET Lambda Functions | AWS Developer Tools Blog
