Documentation ¶
Index ¶
- Constants
- func CopyFile(srcFile, destFile string) error
- func Debug(action string, data ...lager.Data)
- func Debugf(format string, args ...interface{})
- func Error(action string, err error, data ...lager.Data)
- func Errorf(err error, format string, args ...interface{})
- func EscapPath(msg string) string
- func Fatal(action string, err error, data ...lager.Data)
- func Fatalf(err error, format string, args ...interface{})
- func FilterFileList(path, pat string) ([]string, error)
- func Info(action string, data ...lager.Data)
- func Infof(format string, args ...interface{})
- func InitWithConfig(passLagerDef *PassLagerCfg) error
- func InitWithFile(lagerFile string) error
- func LogRotate(path string, MaxFileSize int, MaxBackupCount int)
- func NewLoggerExt(component string, appGUID string, isLogFormatText, isHideLineno bool) lager.Logger
- func RegisterWriter(name string, writer io.Writer)
- func Warn(action string, data ...lager.Data)
- func Warnf(format string, args ...interface{})
- type Config
- type Lager
- type PassLagerCfg
Constants ¶
View Source
const ( RollingPolicySize = "size" RollingPolicyDaily = "daily" LogRotateDate = 1 LogRotateSize = 10 LogBackupCount = 7 )
constant values for logrotate parameters
View Source
const ( //DEBUG is a constant of string type DEBUG = "DEBUG" INFO = "INFO" WARN = "WARN" ERROR = "ERROR" FATAL = "FATAL" )
Variables ¶
This section is empty.
Functions ¶
func FilterFileList ¶
FilterFileList function for filter file list path : where the file will be filtered pat : regexp pattern to filter the matched file
func InitWithConfig ¶
func InitWithConfig(passLagerDef *PassLagerCfg) error
InitWithConfig
use pass lager configuration
func InitWithFile ¶
InitWithFile
readPassLagerConfigFile is unmarshal the paas lager configuration file(log.yaml)
func LogRotate ¶
LogRotate function for log rotate path: where log files need rollover MaxFileSize: MaxSize of a file before rotate. By M Bytes. MaxBackupCount: Max counts to keep of a log's backup files.
func NewLoggerExt ¶
func NewLoggerExt(component string, appGUID string, isLogFormatText, isHideLineno bool) lager.Logger
NewLoggerExt is a function which is used to write new logs
func RegisterWriter ¶
RegisterWriter is used to register a io writer
Types ¶
type Config ¶
type Config struct { LoggerLevel string LoggerFile string Writers []string EnableRsyslog bool RsyslogNetwork string RsyslogAddr string LogFormatText bool LogHideLineno bool }
Config
is a struct which stores details for maintaining logs
type Lager ¶
type Lager struct { Writers string `yaml:"writers"` LoggerLevel string `yaml:"logger_level"` LoggerFile string `yaml:"logger_file"` LogHideLineno bool `yaml:"log_hide_lineno"` LogFormatText bool `yaml:"log_format_text"` RollingPolicy string `yaml:"rolling_policy"` LogRotateDate int `yaml:"log_rotate_date"` LogRotateSize int `yaml:"log_rotate_size"` LogBackupCount int `yaml:"log_backup_count"` }
Lager struct for logger parameters
type PassLagerCfg ¶
type PassLagerCfg struct { Writers string `yaml:"writers"` LoggerLevel string `yaml:"logger_level"` LoggerFile string `yaml:"logger_file"` LogHideLineno bool `yaml:"log_hide_lineno"` LogFormatText bool `yaml:"log_format_text"` RollingPolicy string `yaml:"rolling_policy"` LogRotateDate int `yaml:"log_rotate_date"` LogRotateSize int `yaml:"log_rotate_size"` LogBackupCount int `yaml:"log_backup_count"` }
PassLagerCfg is the struct for lager information(passlager.yaml)
var PassLagerDefinition *PassLagerCfg = DefaultLagerDefinition()
PassLagerDefinition
is having the information about logging
func DefaultLagerDefinition ¶
func DefaultLagerDefinition() *PassLagerCfg
DefaultLagerDefinition
use default lager definition
Click to show internal directories.
Click to hide internal directories.