Documentation ¶
Index ¶
- Constants
- Variables
- func Debug(message ...interface{})
- func Debugf(message ...interface{})
- func Error(message ...interface{})
- func Errorf(message ...interface{})
- func Flush()
- func GetEchoLoggerConfiguration() (*middleware.LoggerConfig, error)
- func GetLogWriter() (io.Writer, error)
- func Info(message ...interface{})
- func Infof(message ...interface{})
- func InitLogger() error
- func Warning(message ...interface{})
- func Warningf(message ...interface{})
- type ILogger
- type Log
- type Logger
Constants ¶
View Source
const ( //MONITOR monitoring logs flag MONITOR string = "MONITOR" //ERROR error logs flag ERROR string = "ERROR" //WARNING Warning logs flag string WARNING string = "WARNING" //INFO informative log message flag string INFO string = "INFO" //DEBUG debug logs flag string DEBUG string = "DEBUG" )
Variables ¶
LogLevels defines loglevel priorities 0 highest and 3 lowest
Functions ¶
func GetEchoLoggerConfiguration ¶
func GetEchoLoggerConfiguration() (*middleware.LoggerConfig, error)
GetEchoLoggerConfiguration creates a LoggerConfig for echo middleware and returns it Uses the same writer as other logs uses
func GetLogWriter ¶
GetLogWriter returns an io.Writer for log if already created returns the same otherwise creates a new buffered Writer and returns
func InitLogger ¶
func InitLogger() error
InitLogger initialise logger object with logWriter and log level
Types ¶
type Log ¶
type Log struct { LogTime time.Time `json:"time"` ProcessName string `json:"process_name"` HostName string `json:"host_name"` ProcessID int `json:"process_id"` Level string `json:"level"` FileName string `json:"file_name"` LineNum int `json:"line_num"` Msg string `json:"log_msg"` }
Log defines the structure of the log message or the log format
Click to show internal directories.
Click to hide internal directories.