s3log

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminFileLogger added in v1.0.4

type AdminFileLogger struct {
	FileLogger
}

FileLogger is a local file audit log

func (*AdminFileLogger) Log added in v1.0.4

func (f *AdminFileLogger) Log(ctx fiber.Ctx, err error, body []byte, meta LogMeta)

Log sends log message to file logger

type AdminLogFields added in v1.0.4

type AdminLogFields struct {
	Time               time.Time
	RemoteIP           string
	Requester          string
	RequestID          string
	HostID             string
	Operation          string
	RequestURI         string
	HttpStatus         int
	ErrorCode          string
	BytesSent          int
	TotalTime          int64
	TurnAroundTime     int64
	Referer            string
	UserAgent          string
	SignatureVersion   string
	CipherSuite        string
	AuthenticationType string
	TLSVersion         string
}

type AuditLogger

type AuditLogger interface {
	Log(ctx fiber.Ctx, err error, body []byte, meta LogMeta)
	HangUp() error
	Shutdown() error
}

func InitAdminFileLogger added in v1.0.4

func InitAdminFileLogger(logname string) (AuditLogger, error)

InitFileLogger initializes audit logs to local file

func InitFileLogger

func InitFileLogger(logname string) (AuditLogger, error)

InitFileLogger initializes audit logs to local file

func InitWebhookLogger

func InitWebhookLogger(url string) (AuditLogger, error)

InitWebhookLogger initializes audit logs to webhook URL

type FileLogger

type FileLogger struct {
	// contains filtered or unexported fields
}

FileLogger is a local file audit log

func (*FileLogger) HangUp

func (f *FileLogger) HangUp() error

HangUp closes current logfile handle and opens a new one typically needed for log rotations

func (*FileLogger) Log

func (f *FileLogger) Log(ctx fiber.Ctx, err error, body []byte, meta LogMeta)

Log sends log message to file logger

func (*FileLogger) Shutdown

func (f *FileLogger) Shutdown() error

Shutdown closes logfile handle

type LogConfig

type LogConfig struct {
	LogFile      string
	WebhookURL   string
	AdminLogFile string
}

type LogFields

type LogFields struct {
	BucketOwner        string
	Bucket             string
	Time               time.Time
	RemoteIP           string
	Requester          string
	RequestID          string
	Operation          string
	Key                string
	RequestURI         string
	HttpStatus         int
	ErrorCode          string
	BytesSent          int
	ObjectSize         int64
	TotalTime          int64
	TurnAroundTime     int64
	Referer            string
	UserAgent          string
	VersionID          string
	HostID             string
	SignatureVersion   string
	CipherSuite        string
	AuthenticationType string
	HostHeader         string
	TLSVersion         string
	AccessPointARN     string
	AclRequired        string
}

type LogMeta

type LogMeta struct {
	BucketOwner string
	ObjectSize  int64
	Action      string
	HttpStatus  int
}

type Loggers added in v1.0.4

type Loggers struct {
	S3Logger    AuditLogger
	AdminLogger AuditLogger
}

func InitLogger

func InitLogger(cfg *LogConfig) (*Loggers, error)

type WebhookLogger

type WebhookLogger struct {
	// contains filtered or unexported fields
}

WebhookLogger is a webhook URL audit log

func (*WebhookLogger) HangUp

func (wl *WebhookLogger) HangUp() error

HangUp does nothing for webhooks

func (*WebhookLogger) Log

func (wl *WebhookLogger) Log(ctx fiber.Ctx, err error, body []byte, meta LogMeta)

Log sends log message to webhook

func (*WebhookLogger) Shutdown

func (wl *WebhookLogger) Shutdown() error

Shutdown does nothing for webhooks

Jump to

Keyboard shortcuts

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