Setting Log Handler Formatter
@ericzbeard 已經在處理了。
開始於 2022年10月13日。
評估
這個 Issue 還沒有評估資料。
描述
I'd like to have logs formatted using ecs_logging and noticed adding a handler to my app does nothing to change the log format in the CloudWatch LogGroup.
This for example has no impact to log format:
LOGGER = logging.getLogger(__package__)
LOGGER.setLevel(level=logging.INFO)
handler = logging.StreamHandler()
handler.setFormatter(ecs_logging.StdlibFormatter())
LOGGER.addHandler(handler)
I also tried brute forcing the formatter with no luck:
def set_formatter():
for logger in logging.root.manager.loggerDict.values():
if isinstance(logger, logging.PlaceHolder):
continue
if logger.hasHandlers():
for handler in logger.handlers:
handler.setFormatter(ecs_logging.StdlibFormatter())
@hook.handler(HookInvocationPoint.CREATE_PRE_PROVISION)
def pre_create_handler(
session: Optional[SessionProxy],
request: BaseHookHandlerRequest,
callback_context: MutableMapping[str, Any],
type_configuration: TypeConfigurationModel,
) -> ProgressEvent:
set_formatter()
LOGGER.info(jsonify_hook_context(request=request))
return ProgressEvent(status=OperationStatus.SUCCESS)
Is there a way to set the format for log output using this library?
- 主要語言
- Python
- 星號
- 107
- 分支
- 46
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
aws-cloudformation/cloudformation-cli-python-plugin 的其他 Issue
-
Support UV未關閉
難度 2/5 1-3 小時 新手友好度 78/100
-
Repo alive?未關閉
難度 5/5 一週以上 新手友好度 20/100
aws-cloudformation/cloudformation-cli-python-plugin#270 · 1 則留言 · 1 個 reaction ·
-
難度 3/5 1-2 天 新手友好度 45/100
-
難度 3/5 1-2 天 新手友好度 35/100
aws-cloudformation/cloudformation-cli-python-plugin#268 · 1 則留言 · 2 個 reaction ·
-
難度 3/5 1-2 天 新手友好度 35/100
aws-cloudformation/cloudformation-cli-python-plugin#264 · 1 則留言 ·
查看 aws-cloudformation/cloudformation-cli-python-plugin 的全部 Issue
相似的 Issue
-
#bug
難度 1/5 1 小時以內 新手友好度 92/100
apache/superset#44923 · 1 則留言 ·
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 84/100
lawndoc/stack-back#123 ·
-
Add: Entune未關閉
難度 2/5 1-3 小時 新手友好度 76/100
AbdelStark/awesome-typesafe-jev#187 ·
維護者通常 1 天內回覆
-
bug good first issue
難度 2/5 1-3 小時 新手友好度 88/100
repowise-dev/repowise#2966 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 84/100
維護者通常 2 天內回覆