Documentation ¶
Index ¶
- Variables
- func AddAuditTarget(t LoggingTarget)
- func AddTarget(t LoggingTarget)
- func AuditLog(ctx context.Context, w http.ResponseWriter, r *http.Request)
- func CriticalIf(ctx context.Context, err error)
- func EnableJSON()
- func EnableQuiet()
- func Fatal(err error, msg string, data ...interface{})
- func FatalIf(err error, msg string, data ...interface{})
- func Info(msg string, data ...interface{})
- func Init(goPath string, goRoot string)
- func LogAlwaysIf(ctx context.Context, err error)
- func LogIf(ctx context.Context, err error)
- func LogOnceIf(ctx context.Context, err error, id interface{})
- func RegisterUIError(f func(string, error, bool) string)
- func SetDeploymentID(id string)
- func SetReqInfo(ctx context.Context, req *ReqInfo) context.Context
- func StartupMessage(msg string, data ...interface{})
- type AuditEntry
- type Console
- type ConsoleTarget
- type HTTPTarget
- type KeyVal
- type Level
- type LoggingTarget
- type PydioLogger
- type PydioTarget
- type ReqInfo
Constants ¶
This section is empty.
Variables ¶
var AuditTargets = []LoggingTarget{}
AuditTargets is the list of enabled audit loggers
var Disable = false
Disable disables all logging, false by default. (used for "go test")
var ErrCritical struct{}
ErrCritical is the value panic'd whenever CriticalIf is called.
var Targets = []LoggingTarget{}
Targets is the set of enabled loggers
Functions ¶
func AddAuditTarget ¶
func AddAuditTarget(t LoggingTarget)
AddAuditTarget adds a new audit logger target to the list of enabled loggers
func AddTarget ¶
func AddTarget(t LoggingTarget)
AddTarget adds a new logger target to the list of enabled loggers
func CriticalIf ¶
CriticalIf logs the provided error on the console. It fails the current go-routine by causing a `panic(ErrCritical)`.
func Fatal ¶
Fatal prints only fatal error message without no stack trace it will be called for input validation failures
func Init ¶
Init sets the trimStrings to possible GOPATHs and GOROOT directories. Also append github.com/minio/minio This is done to clean up the filename, when stack trace is displayed when an error happens.
func LogAlwaysIf ¶
LogAlwaysIf prints a detailed error message during the execution of the server.
func LogIf ¶
LogIf prints a detailed error message during the execution of the server, if it is not an ignored error.
func LogOnceIf ¶
LogOnceIf - Logs notification errors - once per error. id is a unique identifier for related log messages, refer to cmd/notification.go on how it is used.
func RegisterUIError ¶
RegisterUIError registers the specified rendering function. This latter will be called for a pretty rendering of fatal errors.
func SetDeploymentID ¶
func SetDeploymentID(id string)
SetDeploymentID - Used to set the deployment ID, in XL and FS mode
func SetReqInfo ¶
SetReqInfo sets ReqInfo in the context.
Types ¶
type AuditEntry ¶
type AuditEntry struct { Version string `json:"version"` DeploymentID string `json:"deploymentid,omitempty"` Time string `json:"time"` API *api `json:"api,omitempty"` RemoteHost string `json:"remotehost,omitempty"` RequestID string `json:"requestID,omitempty"` UserAgent string `json:"userAgent,omitempty"` ReqQuery map[string]string `json:"requestQuery,omitempty"` ReqHeader map[string]string `json:"requestHeader,omitempty"` RespHeader map[string]string `json:"responseHeader,omitempty"` }
AuditEntry - audit entry logs.
type Console ¶
type Console interface {
// contains filtered or unexported methods
}
Console interface describes the methods that needs to be implemented to satisfy the interface requirements.
type ConsoleTarget ¶
type ConsoleTarget struct{}
ConsoleTarget implements loggerTarget to send log in plain or json format to the standard output.
type HTTPTarget ¶
type HTTPTarget struct {
// contains filtered or unexported fields
}
HTTPTarget implements loggerTarget and sends the json format of a log entry to the configured http endpoint. An internal buffer of logs is maintained but when the buffer is full, new logs are just ignored and an error is returned to the caller.
type LoggingTarget ¶
type LoggingTarget interface {
// contains filtered or unexported methods
}
LoggingTarget is the entity that we will receive a single log entry and send it to the log target
e.g. send the log to a http server
func NewConsole ¶
func NewConsole() LoggingTarget
NewConsole initializes a new logger target which prints log directly in the standard output.
func NewHTTP ¶
func NewHTTP(endpoint string, transport *http.Transport) LoggingTarget
NewHTTP initializes a new logger target which sends log over http to the specified endpoint
func NewPydioTarget ¶
func NewPydioTarget(logger PydioLogger) LoggingTarget
type PydioLogger ¶
type PydioLogger interface { Info(entry interface{}) Error(entry interface{}) Audit(entry interface{}) }
type PydioTarget ¶
type PydioTarget struct {
// contains filtered or unexported fields
}
type ReqInfo ¶
type ReqInfo struct { RemoteHost string // Client Host/IP UserAgent string // User Agent RequestID string // x-amz-request-id API string // API name - GetObject PutObject NewMultipartUpload etc. BucketName string // Bucket name ObjectName string // Object name sync.RWMutex // contains filtered or unexported fields }
ReqInfo stores the request info.
func NewReqInfo ¶
NewReqInfo :
func (*ReqInfo) AppendTags ¶
AppendTags - appends key/val to ReqInfo.tags