Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuditResponseWriter ¶
type AuditResponseWriter struct { http.ResponseWriter URL url.URL // The request URL Identity kes.Identity // The request X.509 identity RequestHeader http.Header // The request headers Time time.Time // The time when we receive the request Logger *log.Logger // contains filtered or unexported fields }
AuditResponseWriter is an http.ResponseWriter implementation that logs (parts of) the request and response before sending the status code back to the client.
func (*AuditResponseWriter) Flush ¶
func (w *AuditResponseWriter) Flush()
func (*AuditResponseWriter) Header ¶
func (w *AuditResponseWriter) Header() http.Header
func (*AuditResponseWriter) WriteHeader ¶
func (w *AuditResponseWriter) WriteHeader(statusCode int)
type FlushWriter ¶
A FlushWriter wraps and io.Writer and performs a flush operation after every write call if the wrapped io.Writer implements http.Flusher.
A FlushWriter is useful when (even small) data should reach the receiver as soon as possible. For example, in case of audit logging.
func NewFlushWriter ¶
func NewFlushWriter(w io.Writer) FlushWriter
NewFlushWriter returns a new flushWriter that wraps w and flushes everything written to it as soon as possible if w implements http.Flusher.
type SystemLog ¶
type SystemLog struct {
// contains filtered or unexported fields
}
SystemLog groups a set of logging targets. It holds a reference to a *log.Logger which gets updated whenever a log target gets added or removed. Since this can happen concurrently, it is not recommended to set the log output of SystemLog.Logger() manually. Instead, modify the *log.Logger output through the SystemLog API.
func NewLogger ¶
NewLogger creates a new SystemLog. The out variable sets the destination to which log data will be written. The prefix appears at the beginning of each generated log line. The flag argument defines the logging properties.
func (*SystemLog) Log ¶
Log returns the actual logger that writes everything to the currently specified output destination.
func (*SystemLog) RemoveOutput ¶
RemoveOutput removes the output destination from the logger, if it exists.