Documentation ¶
Overview ¶
Package logs ...
Index ¶
- Variables
- func Adorn(m logrus.Fields)
- func AuditLog(l *Logging, ctx iris.Context, reqBody map[string]interface{}) *logrus.Entry
- func AuthLog(ctx context.Context) *logrus.Entry
- func LogWithFields(ctx context.Context) *logrus.Entry
- func MaskRequestBody(reqBody map[string]interface{}) string
- func SetFormatter(format LogFormat)
- type LogFormat
- type Logging
- type SysLogFormatter
Constants ¶
This section is empty.
Variables ¶
var Log *logrus.Entry
Log is an instance of logrus.Entry. This instance should be initialized at the start of the each service and will be used for logging
Functions ¶
func AuditLog ¶
AuditLog is used for generating audit logs in syslog format for each request this function logs an info for successful operation and error for failure operation properties logged are prival, time, host, username, roleid, request method, resource, requestbody, responsecode and message
func AuthLog ¶
AuthLog is used for generating security logs in syslog format for each request this function logs an info for successful operation and warning for failure auth operation properties logged are prival, time, username, roleid and message
func LogWithFields ¶
LogWithFields add fields to log
func MaskRequestBody ¶
MaskRequestBody function masking the request body, making password as null
Types ¶
type LogFormat ¶
type LogFormat uint32
LogFormat is custom type created for the log formats supported by ODIM
func ParseLogFormat ¶
ParseLogFormat takes a string level and returns the log format.
func (LogFormat) MarshalText ¶
MarshalText will validate the log format and return the corresponding string
func (*LogFormat) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type SysLogFormatter ¶
type SysLogFormatter struct{}
SysLogFormatter implements logrus Format interface. It provides a formatter for odim in syslog format