Package com.tnsai.observability.errors
Class Slf4jErrorReportPublisher
java.lang.Object
com.tnsai.observability.errors.Slf4jErrorReportPublisher
- All Implemented Interfaces:
ErrorReportPublisher
Default
ErrorReportPublisher — JSON-serialises the report
and writes it via SLF4J at the level matching the report's
ErrorCategory. A Logstash JSON encoder configured on the
com.tnsai.observability.errors.ErrorReport logger picks
the structured payload up; without one, the JSON shows up in
plain text logs which are still grep-able by fingerprint
/ errorCode.
Error level mapping:
ErrorCategory.INTERNAL→ ERROR (framework bug, page on-call)ErrorCategory.SECURITY→ ERROR (audit-relevant)ErrorCategory.PERMANENT,ErrorCategory.CONFIG,ErrorCategory.LOGIC,ErrorCategory.UNKNOWN→ ERROR (user action required)ErrorCategory.TRANSIENT,ErrorCategory.RESOURCE,ErrorCategory.EXTERNAL→ WARN (likely self-healing or expected backpressure; not paging-worthy on its own)
Logger is one-per-error-class (e.g.
com.tnsai.exceptions.LLMException) so consumers can filter
specific exception types separately from the umbrella
ErrorReport channel.
This publisher is registered via SPI in
META-INF/services/com.tnsai.observability.errors.ErrorReportPublisher
so the ErrorReports facade picks it up automatically.
- Since:
- 0.5.0 (issue #86)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidpublish(ErrorReport report) Publish a single error report.
-
Constructor Details
-
Slf4jErrorReportPublisher
public Slf4jErrorReportPublisher()
-
-
Method Details
-
publish
Description copied from interface:ErrorReportPublisherPublish a single error report. Errors during publication must not propagate to the caller — the caller is already in an error path; an exception here would mask the original failure.- Specified by:
publishin interfaceErrorReportPublisher
-