StyraInc / opa-aws-cloudformation-hook

AWS Cloudformation Hook for OPA-powered infrastructure policy enforcement
Apache License 2.0
35 stars 5 forks source link

No Hook logging to CloudWatch logs #36

Closed maslick closed 2 years ago

maslick commented 2 years ago

This issue is connected with https://stackoverflow.com/questions/72526742/cloudformation-hooks-do-not-push-logs-to-cloudwatch-logs

anderseknert commented 2 years ago

That's interesting. The logs showed up in CloudWatch for me when I last tested the hook. I did not provide any custom configuration for cloudwatch, just went with whatever was generated by the init command.

maslick commented 2 years ago

The issue with me was that I forgot to specify log level in the handler code:

# Use this logger to forward log messages to CloudWatch Logs.

LOG = logging.getLogger(__name__)
LOG.setLevel(logging.INFO)            # <- this line was missing
anderseknert commented 2 years ago

Ah! Thanks for following up 👍