Setting Log Handler Formatter
@ericzbeard đang làm issue này rồi.
Từ ngày 13/10/2022.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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?
- Ngôn ngữ chính
- Python
- Star
- 107
- Fork
- 46
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của aws-cloudformation/cloudformation-cli-python-plugin
-
Support UVĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Repo alive?Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
aws-cloudformation/cloudformation-cli-python-plugin#270 · 1 bình luận · 1 reaction ·
-
Improve docstrings for HooksĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
aws-cloudformation/cloudformation-cli-python-plugin#268 · 1 bình luận · 2 reaction ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
aws-cloudformation/cloudformation-cli-python-plugin#264 · 1 bình luận ·
Tất cả issue của aws-cloudformation/cloudformation-cli-python-plugin
Issue tương tự
-
[Bug]: HTTP 499 (Client Closed Request) is classified as a non-retryable format_error, so a mid-flight abort fails the turn over instead of retryingCó thể đã có người làm @yipinghuang1991 đã nhận hôm nay. Đang mởcomp/agent P2 type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
NousResearch/hermes-agent#156837 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug: Missing continue on ValueError in CpanBackend.check_feed causes UnboundLocalError or duplicate yieldsCó thể đã có người làm @muskan-creates352 đã nhận hôm nay. Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 86/100
fedora-infra/anitya#2188 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
docs documentation need-triage SaaS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
integration:hermes
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
vectorize-io/hindsight#6601 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
triage:product type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
dbt-labs/dbt-adapters#2333 ·
Maintainer thường phản hồi trong vòng 1 ngày