Documentation
¶
Overview ¶
Package logging configures a structured zerolog logger and supplies an HTTP writer for shipping log lines to an arbitrary endpoint.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Logger = zerolog.Nop()
Logger is the engine's package-level logger. Call Configure once at boot to wire the writer graph; read it from anywhere in the engine layer
Functions ¶
Types ¶
type HTTPWriter ¶
type HTTPWriter struct {
// contains filtered or unexported fields
}
HTTPWriter posts log lines to a configured URL. Implements zerolog.LevelWriter so Fatal events block until the POST completes while everything else is fire-and-forget.
func NewHTTPWriter ¶
func NewHTTPWriter(url, headerName, headerValue string) *HTTPWriter
NewHTTPWriter constructs a writer that POSTs each log line to url. An empty headerName disables the auth header; otherwise headerValue is sent as headerName on every request.
func (*HTTPWriter) Close ¶
func (h *HTTPWriter) Close() error
Close waits for in-flight goroutines, bounded by httpCloseTimeout.
func (*HTTPWriter) Write ¶
func (h *HTTPWriter) Write(p []byte) (int, error)
Write sends p in a detached goroutine. Errors are dropped; the only contract is best-effort delivery.
func (*HTTPWriter) WriteLevel ¶
WriteLevel dispatches per level. Fatal sends synchronously so the log line lands before os.Exit fires inside zerolog's Fatal path.