googleapis / googleapis/google-cloud-python

Let Cloud Run Job use `StructuredLogHandler` instead of `ClougLoggingHandler`

オープン
#15,407 コメント 1 件 リアクション 0 件 担当者 1 名 @gkevinzheng に割り当て済み GitHub で見る
api: logging type: feature request
主要言語
Python
スター
5.4k
フォーク
1.8k
平均マージ
3日 4時間
マージ済み PR(30日)
122

説明

**Is your feature request related to a problem? Please describe.**
When using `Client.get_default_handler` `CloudLoggingHandler` is being used automatically for Cloud Run jobs resource. And while https://github.com/googleapis/python-logging/pull/877 fixes the missing labels we're still gonna be using background transport when simplier stdout is doing just fine.

**Describe the solution you'd like**
If we modify this check https://github.com/googleapis/python-logging/blob/62641075042a3da9bb9c059d963bad14a1586b1c/google/cloud/logging_v2/client.py#L388 and allow `_RUN_RESOURCE_TYPE` OR `_CLOUD_RUN_JOB_RESOURCE_TYPE` resource type then a structured log handler is gonna be used automatically which should be a better default.

**Describe alternatives you've considered**
Meanwhile I am using `handler = StructuredLogHandler(project_id=client.project)` instead of `handler = client.get_default_handler()` where client is `client = CloudLoggingClient()`

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。