Documentation ¶
Overview ¶
Package audit log the beginning and end of each API request to different logger. The records also contains information about the request status and error message if it fails.
Index ¶
- Constants
- func LoggerExists(ctx context.Context) (exists bool)
- func NewBlobStore(ctx context.Context, bs distribution.BlobStore) distribution.BlobStore
- func NewManifestService(ctx context.Context, ms distribution.ManifestService) distribution.ManifestService
- func NewTagService(ctx context.Context, ts distribution.TagService) distribution.TagService
- func WithLogger(ctx context.Context, logger *Logger) context.Context
- type Logger
Constants ¶
const ( LogEntryType = "openshift.logger" AuditUserEntry = "openshift.auth.user" AuditUserIDEntry = "openshift.auth.userid" AuditStatusEntry = "openshift.request.status" AuditErrorEntry = "openshift.request.error" DefaultLoggerType = "registry" AuditLoggerType = "audit" OpStatusBegin = "begin" OpStatusError = "error" OpStatusOK = "success" )
Variables ¶
This section is empty.
Functions ¶
func LoggerExists ¶
LoggerExists checks audit logger existence.
func NewBlobStore ¶
func NewBlobStore(ctx context.Context, bs distribution.BlobStore) distribution.BlobStore
NewBlobStore wraps a distribution.BlobStore to track operation results and write them to the audit log.
func NewManifestService ¶
func NewManifestService(ctx context.Context, ms distribution.ManifestService) distribution.ManifestService
NewManifestService wraps a distribution.ManifestService to track operation results and write them to the audit log.
func NewTagService ¶
func NewTagService(ctx context.Context, ts distribution.TagService) distribution.TagService
NewTagService wraps a distribution.TagService to track operation results and write them to the audit log,
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger implements special audit log. We can't use the system logger because the change of log level can hide the audit logs.
func GetLogger ¶
GetLogger returns the logger from the current context, if present. It will be created otherwise.
func (*Logger) LogResultf ¶
LogResultf formats record according to a format with additional operation status.
func (*Logger) SetFormatter ¶
SetFormatter sets the audit logger formatter.