You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
with the intent that logger.warning('log message')
would go to a dedicated log stream (hf.today would be "2022-03-17", etc), so that the logging traffic doesn't get mixed up in the standard CloudWatch logs which I'm emitting with logger.info()
Anyway, the above didn't work until I added use_queues=False.
Is my initialization code incorrect, or is something within use_queues not working as expected? I saw the comment about Django, but I'm not using Django.
Because this logging is occurring in short-lived AWS Lambda python functions, I'm not too concerned about the queues, other than it seems like it's not working.
If I am using this in a Lambda, and I do want to use the queues, do I need an explicit close / flush? Is that why my log messages aren't getting to CloudWatch?
The text was updated successfully, but these errors were encountered:
If you consult the documentation for the AWS Lambda execution environment (https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html) you will note that AWS Lambda suspends (freezes) all processes in the environment once the invocation is complete and until the next invocation, if any. This means any asynchronous background processes and threads, including watchtower, will be suspended and inoperable, so watchtower cannot function correctly in this execution model.
If for some reason you want to keep using watchtower in Lambda, you can force the logs to flush by calling flush() on the handler, however that may have performance implications for your Lambda and is not advised.
I am using the following bit of initialization code in an AWS Lambda function.
with the intent that logger.warning('log message')
would go to a dedicated log stream (hf.today would be "2022-03-17", etc), so that the logging traffic doesn't get mixed up in the standard CloudWatch logs which I'm emitting with logger.info()
Anyway, the above didn't work until I added use_queues=False.
Is my initialization code incorrect, or is something within use_queues not working as expected? I saw the comment about Django, but I'm not using Django.
Because this logging is occurring in short-lived AWS Lambda python functions, I'm not too concerned about the queues, other than it seems like it's not working.
If I am using this in a Lambda, and I do want to use the queues, do I need an explicit close / flush? Is that why my log messages aren't getting to CloudWatch?
The text was updated successfully, but these errors were encountered: