Title: logger.propagate=False issue · Issue #1 · ZooliteEU/lambda-python-logging-example · GitHub
Open Graph Title: logger.propagate=False issue · Issue #1 · ZooliteEU/lambda-python-logging-example
X Title: logger.propagate=False issue · Issue #1 · ZooliteEU/lambda-python-logging-example
Description: Hello, I am pretty new to learning Python and I am trying to set up JSON formatting for Lambda Python function. I came across your blog/repo and it's very helpful (thank you!). However, I am running into an issue. I am using your custom_...
Open Graph Description: Hello, I am pretty new to learning Python and I am trying to set up JSON formatting for Lambda Python function. I came across your blog/repo and it's very helpful (thank you!). However, I am runnin...
X Description: Hello, I am pretty new to learning Python and I am trying to set up JSON formatting for Lambda Python function. I came across your blog/repo and it's very helpful (thank you!). However, I am ru...
Opengraph URL: https://github.com/ZooliteEU/lambda-python-logging-example/issues/1
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"logger.propagate=False issue","articleBody":"Hello,\r\n\r\nI am pretty new to learning Python and I am trying to set up JSON formatting for Lambda Python function. I came across your blog/repo and it's very helpful (thank you!). \r\n\r\nHowever, I am running into an issue. I am using your custom_logger.py. I get the JSON formatted error with the error message being correct. But, the CloudWatch logs also show the usual Lambda error \"[ERROR] ClientError: An error occurred (404) when calling the HeadObject operation...\" even though the logger.propagate=False is set in the custom_logger. I did check if the property is being set up correctly (by printing it to logs), and it is indeed set as false.\r\n\r\nAny ideas?\r\n\r\nI set up LOGGER as:\r\n\r\n```\r\n# Setup logging\r\nFUNCTION_NAME = {\"function\": os.getenv(\"AWS_LAMBDA_FUNCTION_NAME\")}\r\nLOGGER, ADAPTER = custom_logger.setup_logger(FUNCTION_NAME)\r\n```\r\n\r\nFunction that throws the error:\r\n\r\n```\r\ndef aws_s3_read(bucket_name, object_key):\r\n \r\n client = boto3.client('s3', region_name = 'ca-central-1')\r\n tmpkey = object_key.replace('/', '')\r\n download_path = '/tmp/{}'.format(tmpkey)\r\n \r\n try:\r\n client.download_file(bucket_name, object_key, download_path)\r\n except ClientError as err:\r\n LOGGER.error(err.response['Error']['Code'] + \" \" + err.response['Error']['Message'])\r\n raise err\r\n finally:\r\n # Optionally do something to be executed regardless if the try block raises an error or not\r\n LOGGER.info(\"FINAL BLOCK\")\r\n \r\n LOGGER.info(\"Downloaded object \" + object_key + \" from S3 bucket \" + bucket_name + \" into file \" + download_path)\r\n return\r\n```","author":{"url":"https://github.com/borkod","@type":"Person","name":"borkod"},"datePublished":"2021-01-30T14:31:48.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/1/lambda-python-logging-example/issues/1"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e3cda461-62c3-4131-c4ff-8c1d9c7c0ec4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AF60:3CBD01:6202B5:847199:6A56987F |
| html-safe-nonce | d3a848b56d81faa1a3d65077ae6e0ee52a3bc49c441cb9b33adcfb442d4cab74 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRjYwOjNDQkQwMTo2MjAyQjU6ODQ3MTk5OjZBNTY5ODdGIiwidmlzaXRvcl9pZCI6IjEwMDgzMjc0MzM3NTY1MTQ0MzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9947dbfac9d4f46174a6eda0588e1092da134056f343933facd99bd5647744f7 |
| hovercard-subject-tag | issue:797433082 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/ZooliteEU/lambda-python-logging-example/1/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1679ffe10f4bb0cece92e56628feea142eb163add405572830324323f2c274fe/ZooliteEU/lambda-python-logging-example/issues/1 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1679ffe10f4bb0cece92e56628feea142eb163add405572830324323f2c274fe/ZooliteEU/lambda-python-logging-example/issues/1 |
| og:image:alt | Hello, I am pretty new to learning Python and I am trying to set up JSON formatting for Lambda Python function. I came across your blog/repo and it's very helpful (thank you!). However, I am runnin... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | borkod |
| hostname | github.com |
| expected-hostname | github.com |
| None | 647a25f437e2f54eccdd162bd007c8ae70f4235c4125dba0f4518747cc8b9615 |
| turbo-cache-control | no-preview |
| go-import | github.com/ZooliteEU/lambda-python-logging-example git https://github.com/ZooliteEU/lambda-python-logging-example.git |
| octolytics-dimension-user_id | 45125744 |
| octolytics-dimension-user_login | ZooliteEU |
| octolytics-dimension-repository_id | 230512637 |
| octolytics-dimension-repository_nwo | ZooliteEU/lambda-python-logging-example |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 230512637 |
| octolytics-dimension-repository_network_root_nwo | ZooliteEU/lambda-python-logging-example |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 05adb86a60ce3d701e556eded3ab26300ec6bcc4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width