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
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ự
-
Add: hunch Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
AbdelStark/awesome-typesafe#104 ·
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
DiamondLightSource/dodal#2211 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
openml/openml-python#1749 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
sipyourdrink-ltd/bernstein#6191 ·