querylog

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 32 Imported by: 1 module, 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

func LogEntryFields

func LogEntryFields(entry *LogEntry) logrus.Fields

Types

type DatabaseWriter

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

func NewDatabaseWriter

func NewDatabaseWriter(ctx context.Context, dbType config.QueryLogType, target string, logRetentionDays uint64,
	dbFlushPeriod time.Duration,
) (*DatabaseWriter, error)

func (*DatabaseWriter) CleanUp

func (d *DatabaseWriter) CleanUp()

func (*DatabaseWriter) Write

func (d *DatabaseWriter) Write(entry *LogEntry)

type DnstapWriter added in v0.33.0

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

func NewDnstapWriter added in v0.33.0

func NewDnstapWriter(target string, flushInterval time.Duration, instanceID string) (*DnstapWriter, error)

func (*DnstapWriter) CleanUp added in v0.33.0

func (d *DnstapWriter) CleanUp()

CleanUp implements the retention-cleanup hook of the Writer interface. dnstap is a streaming export with nothing to prune, so this is a no-op; lifecycle teardown happens in Close instead.

func (*DnstapWriter) Close added in v0.33.0

func (d *DnstapWriter) Close() error

Close signals shutdown: it stops accepting frames so the run goroutine stops and closes the socket itself. It deliberately does not touch d.writer — run owns it, and the dnstap socketWriter is not safe for a Close concurrent with an in-flight WriteFrame — and never waits on an in-flight WriteFrame, so a stuck collector connection cannot hang shutdown.

func (*DnstapWriter) Write added in v0.33.0

func (d *DnstapWriter) Write(entry *LogEntry)

type FileWriter

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

func NewCSVWriter

func NewCSVWriter(target string, perClient bool, logRetentionDays uint64) (*FileWriter, error)

func (*FileWriter) CleanUp

func (d *FileWriter) CleanUp()

CleanUp deletes old log files

func (*FileWriter) Write

func (d *FileWriter) Write(entry *LogEntry)

type LogEntry

type LogEntry struct {
	Start          time.Time
	ClientIP       string
	ClientNames    []string
	DurationMs     int64
	ResponseReason string
	ResponseType   string
	ResponseCode   string
	QuestionType   string
	QuestionName   string
	Answer         string
	BlockyInstance string
	QueryWire      []byte
	ResponseWire   []byte
	QueryTime      time.Time
	ResponseTime   time.Time
	SocketProtocol model.RequestProtocol
}

type LoggerWriter

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

func NewLoggerWriter

func NewLoggerWriter() *LoggerWriter

func (*LoggerWriter) CleanUp

func (d *LoggerWriter) CleanUp()

func (*LoggerWriter) Write

func (d *LoggerWriter) Write(entry *LogEntry)

type NoneWriter

type NoneWriter struct{}

func NewNoneWriter

func NewNoneWriter() *NoneWriter

func (*NoneWriter) CleanUp

func (d *NoneWriter) CleanUp()

func (*NoneWriter) Write

func (d *NoneWriter) Write(*LogEntry)

type Writer

type Writer interface {
	Write(entry *LogEntry)
	CleanUp()
}

Jump to

Keyboard shortcuts

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