Documentation
¶
Overview ¶
Package logs creates a Multi writer instance that write all logs that are written to stdout.
Index ¶
- func BuilderIndexLabel(idx primitives.BuilderIndex) string
- func ConfigureEphemeralLogFile(datadirPath string, app string) error
- func ConfigurePersistentLogging(logFileName string, format string, lvl logrus.Level, ...) error
- func MaskCredentialsLogging(currUrl string) string
- func PackageVerbosity(packagePath string) logrus.Level
- func SetLoggingLevelAndData(baseVerbosity logrus.Level, vmoduleMap map[string]logrus.Level, ...)
- type HookIdentifier
- type StreamServer
- type Streamer
- type WriterHook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuilderIndexLabel ¶ added in v7.1.7
func BuilderIndexLabel(idx primitives.BuilderIndex) string
func ConfigureEphemeralLogFile ¶ added in v7.1.3
ConfigureEphemeralLogFile adds a log file that keeps 24 hours of logs with >debug verbosity.
func ConfigurePersistentLogging ¶
func ConfigurePersistentLogging(logFileName string, format string, lvl logrus.Level, vmodule map[string]logrus.Level) error
ConfigurePersistentLogging adds a log-to-file writer. File content is identical to stdout.
func MaskCredentialsLogging ¶
MaskCredentialsLogging masks the url credentials before logging for security purpose [scheme:][//[userinfo@]host][/]path[?query][#fragment] --> [scheme:][//[***]host][/***][#***] if the format is not matched nothing is done, string is returned as is.
func PackageVerbosity ¶ added in v7.1.3
PackageVerbosity returns the verbosity of a given package.
Types ¶
type HookIdentifier ¶ added in v7.1.3
type HookIdentifier string
const ( LogTargetField = "log_target" LogTargetEphemeral HookIdentifier = "ephemeral" LogTargetUser HookIdentifier = "user" )
type StreamServer ¶
type StreamServer struct {
// contains filtered or unexported fields
}
StreamServer defines a websocket server which can receive events from a feed and write them to open websocket connections.
func NewStreamServer ¶
func NewStreamServer() *StreamServer
NewStreamServer initializes a new stream server capable of streaming log events.
func (*StreamServer) GetLastFewLogs ¶
func (ss *StreamServer) GetLastFewLogs() [][]byte
GetLastFewLogs returns the last few entries of logs stored in an LRU cache.
func (*StreamServer) LogsFeed ¶
func (ss *StreamServer) LogsFeed() *event.Feed
LogsFeed returns a feed callers can subscribe to receive logs via a channel.
type WriterHook ¶ added in v7.1.3
type WriterHook struct {
AllowedLevels []logrus.Level
Writer io.Writer
Formatter logrus.Formatter
Identifier HookIdentifier
}
func (*WriterHook) Levels ¶ added in v7.1.3
func (hook *WriterHook) Levels() []logrus.Level