Setting Log Handler Formatter
@ericzbeard y travaille déjà.
Depuis le 13/10/2022.
Évaluation
Cette issue n'a pas encore été évaluée.
Description
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?
- Langage dominant
- Python
- Étoiles
- 107
- Forks
- 46
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de aws-cloudformation/cloudformation-cli-python-plugin
-
Support UV Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
Repo alive? Ouverte
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 20/100
aws-cloudformation/cloudformation-cli-python-plugin#270 · 1 commentaire · 1 réaction ·
-
Improve docstrings for Hooks Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 45/100
-
Difficulté 3/5 1-2 jours Accessibilité débutants 35/100
aws-cloudformation/cloudformation-cli-python-plugin#268 · 1 commentaire · 2 réactions ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 35/100
aws-cloudformation/cloudformation-cli-python-plugin#264 · 1 commentaire ·
Toutes les issues de aws-cloudformation/cloudformation-cli-python-plugin
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
anthropics/skills#1811 · 1 commentaire ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
speaches-ai/speaches#678 ·
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
datalayer/mcp-compose#42 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
conda-forge/spacy-feedstock#177 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
UKGovernmentBEIS/inspect_evals#2523 ·