Title: Improve handling of "Log entry with size X exceeds maximum size" · Issue #53 · googleapis/python-logging · GitHub
Open Graph Title: Improve handling of "Log entry with size X exceeds maximum size" · Issue #53 · googleapis/python-logging
X Title: Improve handling of "Log entry with size X exceeds maximum size" · Issue #53 · googleapis/python-logging
Description: Hi, Lib version: google-cloud-logging==1.15.0 I'm experiencing lots of errors like: Traceback (most recent call last): File "/env/lib/python3.7/site-packages/google/cloud/logging/handlers/transports/background_thread.py", line 123, in _s...
Open Graph Description: Hi, Lib version: google-cloud-logging==1.15.0 I'm experiencing lots of errors like: Traceback (most recent call last): File "/env/lib/python3.7/site-packages/google/cloud/logging/handlers/transport...
X Description: Hi, Lib version: google-cloud-logging==1.15.0 I'm experiencing lots of errors like: Traceback (most recent call last): File "/env/lib/python3.7/site-packages/google/cloud/logging/handlers/...
Opengraph URL: https://github.com/googleapis/python-logging/issues/53
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Improve handling of \"Log entry with size X exceeds maximum size\"","articleBody":"Hi,\r\n\r\nLib version: google-cloud-logging==1.15.0 \r\n\r\nI'm experiencing lots of errors like:\r\n```\r\nTraceback (most recent call last):\r\n File \"/env/lib/python3.7/site-packages/google/cloud/logging/handlers/transports/background_thread.py\", line 123, in _safely_commit_batch\r\n batch.commit()\r\n File \"/env/lib/python3.7/site-packages/google/cloud/logging/logger.py\", line 383, in commit\r\n client.logging_api.write_entries(entries, **kwargs)\r\n File \"/env/lib/python3.7/site-packages/google/cloud/logging/_gapic.py\", line 126, in write_entries\r\n partial_success=partial_success,\r\n File \"/env/lib/python3.7/site-packages/google/cloud/logging_v2/gapic/logging_service_v2_client.py\", line 477, in write_log_entries\r\n request, retry=retry, timeout=timeout, metadata=metadata\r\n File \"/env/lib/python3.7/site-packages/google/api_core/gapic_v1/method.py\", line 143, in __call__\r\n return wrapped_func(*args, **kwargs)\r\n File \"/env/lib/python3.7/site-packages/google/api_core/retry.py\", line 286, in retry_wrapped_func\r\n on_error=on_error,\r\n File \"/env/lib/python3.7/site-packages/google/api_core/retry.py\", line 184, in retry_target\r\n return target()\r\n File \"/env/lib/python3.7/site-packages/google/api_core/timeout.py\", line 214, in func_with_timeout\r\n return func(*args, **kwargs)\r\n File \"/env/lib/python3.7/site-packages/google/api_core/grpc_helpers.py\", line 59, in error_remapped_callable\r\n six.raise_from(exceptions.from_grpc_error(exc), exc)\r\n File \"\u003cstring\u003e\", line 3, in raise_from\r\ngoogle.api_core.exceptions.InvalidArgument: 400 Log entry with size 256.6K exceeds maximum size of 256.0K\r\n```\r\nThis traceback doesn't help me identify place where the offending line was logged (I'm using python logging), so I cannot fix it.\r\n\r\nI can see at least 3 resolutions to this:\r\n- allow user to specify that log message can be cropped to max size before sending to Cloud Logging. This way, if someone is ok with it, everything will get (at least partially) logged\r\n- add to the traceback information where the offending log entry was logged (file name + line number). This way I may be able to identify and fix too long log lines - right now there's no such information.\r\n- verify the log message size eagerly when logging, i.e. throw exception from methods like `logging.info` when the message is too long and we won't be able to upload it (so rather than doing the verification in a background thread, do it immediately)\r\n\r\n","author":{"url":"https://github.com/przemekpastuszka","@type":"Person","name":"przemekpastuszka"},"datePublished":"2020-07-08T11:38:50.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":20},"url":"https://github.com/53/python-logging/issues/53"}
| 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:24c6e187-75d6-c51f-e4d8-ad981f40b75f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 88EA:195DA5:B6D47C:F626B2:6A5164BD |
| html-safe-nonce | 98192785e6539e63cfcd750e5dd9530e36d0d88148ef82dd69e03f3cecce40a6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OEVBOjE5NURBNTpCNkQ0N0M6RjYyNkIyOjZBNTE2NEJEIiwidmlzaXRvcl9pZCI6IjgzNDA3NDM3MjY1OTU5MjUxODEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7422639b5e207d065daaa8bc04d6e33dab4decf39a3f25d13a947bf581be3ee1 |
| hovercard-subject-tag | issue:653223936 |
| 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/googleapis/python-logging/53/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4cda9c586e3d066fe85acccb3385b3ab199350d1426e7822c8038c83886ddf9c/googleapis/python-logging/issues/53 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4cda9c586e3d066fe85acccb3385b3ab199350d1426e7822c8038c83886ddf9c/googleapis/python-logging/issues/53 |
| og:image:alt | Hi, Lib version: google-cloud-logging==1.15.0 I'm experiencing lots of errors like: Traceback (most recent call last): File "/env/lib/python3.7/site-packages/google/cloud/logging/handlers/transport... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | przemekpastuszka |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/python-logging git https://github.com/googleapis/python-logging.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 226992562 |
| octolytics-dimension-repository_nwo | googleapis/python-logging |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 226992562 |
| octolytics-dimension-repository_network_root_nwo | googleapis/python-logging |
| 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 | 2eeb434949a926fad21064b4d395a54759f7a0b2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width