errorlog

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorLog

type ErrorLog struct {
	// contains filtered or unexported fields
}
var Global *ErrorLog

Global is set from main.go so both handler and middleware packages can log errors without circular imports.

func Open

func Open(dbPath string) (*ErrorLog, error)

func (*ErrorLog) Close

func (el *ErrorLog) Close() error

func (*ErrorLog) Log

func (el *ErrorLog) Log(tenantID, method, path string, statusCode int, errorMsg string)

func (*ErrorLog) Query

func (el *ErrorLog) Query(ctx context.Context, tenantID string, limit, offset int) ([]LogEntry, int, error)

func (*ErrorLog) StartCleanup

func (el *ErrorLog) StartCleanup(ctx context.Context)

type LogEntry

type LogEntry struct {
	ID           int64  `json:"id"`
	Timestamp    string `json:"timestamp"`
	TenantID     string `json:"tenant_id"`
	Method       string `json:"method"`
	Path         string `json:"path"`
	StatusCode   int    `json:"status_code"`
	ErrorMessage string `json:"error_message"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL