fluent / fluent/fluent-logger-java

Improving error handling

Ouverte
#15 15 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Java
Étoiles
210
Forks
86
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

I and @komamitsu san discussed how to improve error reporting of the current 0.2.x versions.

The major changes we considered are:
- Add `setHandler(handler)` method to FluentLogger to accept an application-specific error handler.
- In the error handler, provide a method for retrieving the remaining logs (the last one or all logs) that are not yet sent to fluentd.
- The last logs are message packed Event objects. We need to provide a decoder so that the last log is meaningful to the user.

In this change, we should consider the following problem:
- (Plan 1) A timing to report error. Currently errors can be reported in three ways: return value of `log` method (true or false), unmanaged exceptions or exceptions thrown when the buffer is full. If an error handler is added, `log` method should be **non-blocking** method, and the error must be handled in the user-defined error handler (in the subsequent code or in another thread). Does it the right choice?

Another option would be:
- (Plan 2) Making `log` a **blocking** method and reporting errors by Exception rather than returning true or false. The last log event should be included in the thrown exception.

After writing this ticket, Plan 2 now looks simpler to me.
Any idea?

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Start by reviewing the FluentLogger API and the current error paths described for log return values, unmanaged exceptions, and buffer-full exceptions. Compare the proposed handler and blocking-exception plans, including access to unsent message-packed Event objects. Done requires an agreed design and a defined error-reporting behavior for the 0.2.x versions.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
java
Domaine
observability-sre
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
20/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.