package logging

import "github.com/hashicorp/vault/sdk/helper/logging"

Index

Functions

func NewVaultLogger

func NewVaultLogger(level log.Level) log.Logger

NewVaultLogger creates a new logger with the specified level and a Vault formatter

func NewVaultLoggerWithWriter

func NewVaultLoggerWithWriter(w io.Writer, level log.Level) log.Logger

NewVaultLoggerWithWriter creates a new logger with the specified level and writer and a Vault formatter

Types

type LogFormat

type LogFormat int
const (
	UnspecifiedFormat LogFormat = iota
	StandardFormat
	JSONFormat
)

func ParseEnvLogFormat

func ParseEnvLogFormat() LogFormat

ParseEnvLogFormat parses the log format from an environment variable.

func ParseLogFormat

func ParseLogFormat(format string) (LogFormat, error)

ParseLogFormat parses the log format from the provided string.

func (LogFormat) String

func (l LogFormat) String() string

Stringer implementation

Source Files

logging.go

Version
v0.18.0 (latest)
Published
Jun 5, 2025
Platform
linux/amd64
Imports
5 packages
Last checked
1 month ago

Tools for package owners.