log_kafka

package module
v0.0.0-...-69586bb Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: MIT Imports: 14 Imported by: 0

README

caddy-log-kafka

A Caddy log writer that writes logs to Kafka.

Usage

This is a Caddy log output module so you can configure it in your Caddyfile:

example.com {
  log {
    output kafka {
      address kafka.default.svc.cluster.local:9092
      topic "com.example.caddy-log.{args.0}"
      partition 0
    }
    format json
  }
}

Processing the logs

I use the following tools to analyze the logs:

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KafkaLogger

type KafkaLogger struct {
	Address   string `json:"address"`
	Topic     string `json:"topic"`
	Partition int64  `json:"partition"`
	// contains filtered or unexported fields
}

Reference: https://github.com/caddyserver/caddy/blob/e3c369d4526e44f23efb10aaad8a60ce519720a0/modules/logging/netwriter.go

func (KafkaLogger) CaddyModule

func (KafkaLogger) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (*KafkaLogger) Cleanup

func (k *KafkaLogger) Cleanup() error

func (*KafkaLogger) OpenWriter

func (k *KafkaLogger) OpenWriter() (io.WriteCloser, error)

func (*KafkaLogger) Provision

func (k *KafkaLogger) Provision(ctx caddy.Context) error

func (*KafkaLogger) String

func (k *KafkaLogger) String() string

func (*KafkaLogger) UnmarshalCaddyfile

func (k *KafkaLogger) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

UnmarshalCaddyfile implements caddyfile.Unmarshaler.

func (*KafkaLogger) Validate

func (k *KafkaLogger) Validate() error

Validate implements caddy.Validator.

func (*KafkaLogger) WriterKey

func (k *KafkaLogger) WriterKey() string

type LogWriter

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

func (*LogWriter) Close

func (w *LogWriter) Close() error

func (*LogWriter) Write

func (w *LogWriter) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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