MM-23222 mirror audit logs to file (#14062)
* MM-23222 add file target (with rotation) to audit
* MM-23222 mirror syslog audits to local filesystem
* provides config options for file name, max size, max age
* rotates files based on max size and max age; delete as needed based on max backups
* include cluster id in log records
* sort meta data fields
Этот коммит содержится в:
@@ -151,7 +151,7 @@ func (a *App) GetAnalytics(name string, teamId string) (model.AnalyticsRows, *mo
|
|||||||
}
|
}
|
||||||
rows[4].Value = float64(r.Data.(int64))
|
rows[4].Value = float64(r.Data.(int64))
|
||||||
|
|
||||||
// If in HA mode then aggregrate all the stats
|
// If in HA mode then aggregate all the stats
|
||||||
if a.Cluster() != nil && *a.Config().ClusterSettings.Enable {
|
if a.Cluster() != nil && *a.Config().ClusterSettings.Enable {
|
||||||
stats, err := a.Cluster().GetClusterStats()
|
stats, err := a.Cluster().GetClusterStats()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
50
app/audit.go
50
app/audit.go
@@ -37,28 +37,28 @@ func (s *Server) configureAudit(adt *audit.Audit) {
|
|||||||
adt.OnQueueFull = s.onAuditTargetQueueFull
|
adt.OnQueueFull = s.onAuditTargetQueueFull
|
||||||
adt.OnError = s.onAuditError
|
adt.OnError = s.onAuditError
|
||||||
|
|
||||||
// For now we only support sending audit records to Syslog via TLS.
|
// Configure target for SysLog via TLS.
|
||||||
// See https://www.rsyslog.com/doc/v8-stable/tutorials/tls_cert_summary.html
|
// See https://www.rsyslog.com/doc/v8-stable/tutorials/tls_cert_summary.html
|
||||||
if *s.Config().ExperimentalAuditSettings.Enabled {
|
if *s.Config().ExperimentalAuditSettings.SysLogEnabled {
|
||||||
IP := *s.Config().ExperimentalAuditSettings.IP
|
IP := *s.Config().ExperimentalAuditSettings.SysLogIP
|
||||||
if IP == "" {
|
if IP == "" {
|
||||||
IP = "localhost"
|
IP = "localhost"
|
||||||
}
|
}
|
||||||
port := *s.Config().ExperimentalAuditSettings.Port
|
port := *s.Config().ExperimentalAuditSettings.SysLogPort
|
||||||
if port <= 0 {
|
if port <= 0 {
|
||||||
port = 6514
|
port = 6514
|
||||||
}
|
}
|
||||||
raddr := fmt.Sprintf("%s:%d", IP, port)
|
raddr := fmt.Sprintf("%s:%d", IP, port)
|
||||||
maxQSize := *s.Config().ExperimentalAuditSettings.MaxQSize
|
maxQSize := *s.Config().ExperimentalAuditSettings.SysLogMaxQueueSize
|
||||||
if maxQSize <= 0 {
|
if maxQSize <= 0 {
|
||||||
maxQSize = audit.DefMaxQueueSize
|
maxQSize = audit.DefMaxQueueSize
|
||||||
}
|
}
|
||||||
|
|
||||||
params := &audit.SyslogParams{
|
params := &audit.SyslogParams{
|
||||||
Raddr: raddr,
|
Raddr: raddr,
|
||||||
Cert: *s.Config().ExperimentalAuditSettings.Cert,
|
Cert: *s.Config().ExperimentalAuditSettings.SysLogCert,
|
||||||
Tag: *s.Config().ExperimentalAuditSettings.Tag,
|
Tag: *s.Config().ExperimentalAuditSettings.SysLogTag,
|
||||||
Insecure: *s.Config().ExperimentalAuditSettings.Insecure,
|
Insecure: *s.Config().ExperimentalAuditSettings.SysLogInsecure,
|
||||||
}
|
}
|
||||||
|
|
||||||
filter := adt.MakeFilter(RestLevel, RestContentLevel, RestPermsLevel, CLILevel)
|
filter := adt.MakeFilter(RestLevel, RestContentLevel, RestPermsLevel, CLILevel)
|
||||||
@@ -66,10 +66,38 @@ func (s *Server) configureAudit(adt *audit.Audit) {
|
|||||||
target, err := audit.NewSyslogTLSTarget(filter, formatter, params, maxQSize)
|
target, err := audit.NewSyslogTLSTarget(filter, formatter, params, maxQSize)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
mlog.Error("cannot configure SysLogTLS audit target", mlog.Err(err))
|
mlog.Error("cannot configure SysLogTLS audit target", mlog.Err(err))
|
||||||
return
|
} else {
|
||||||
|
mlog.Debug("SysLogTLS audit target connected successfully", mlog.String("raddr", raddr))
|
||||||
|
adt.AddTarget(target)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Configure target for rotating file output
|
||||||
|
if *s.Config().ExperimentalAuditSettings.FileEnabled {
|
||||||
|
opts := audit.FileOptions{
|
||||||
|
Filename: *s.Config().ExperimentalAuditSettings.FileName,
|
||||||
|
MaxSize: *s.Config().ExperimentalAuditSettings.FileMaxSizeMB,
|
||||||
|
MaxAge: *s.Config().ExperimentalAuditSettings.FileMaxAgeDays,
|
||||||
|
MaxBackups: *s.Config().ExperimentalAuditSettings.FileMaxBackups,
|
||||||
|
Compress: *s.Config().ExperimentalAuditSettings.FileCompress,
|
||||||
|
}
|
||||||
|
|
||||||
|
maxQueueSize := *s.Config().ExperimentalAuditSettings.FileMaxQueueSize
|
||||||
|
if maxQueueSize <= 0 {
|
||||||
|
maxQueueSize = audit.DefMaxQueueSize
|
||||||
|
}
|
||||||
|
|
||||||
|
filter := adt.MakeFilter(RestLevel, RestContentLevel, RestPermsLevel, CLILevel)
|
||||||
|
formatter := adt.MakeJSONFormatter()
|
||||||
|
formatter.DisableTimestamp = false
|
||||||
|
formatter.Indent = "\n"
|
||||||
|
target, err := audit.NewFileTarget(filter, formatter, opts, maxQueueSize)
|
||||||
|
if err != nil {
|
||||||
|
mlog.Error("cannot configure File audit target", mlog.Err(err))
|
||||||
|
} else {
|
||||||
|
mlog.Debug("File audit target created successfully", mlog.String("filename", opts.Filename))
|
||||||
|
adt.AddTarget(target)
|
||||||
}
|
}
|
||||||
mlog.Debug("SysLogTLS audit target connected successfully", mlog.String("raddy", raddr))
|
|
||||||
adt.AddTarget(target)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ package audit
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"sort"
|
||||||
|
|
||||||
"github.com/wiggin77/logr"
|
"github.com/wiggin77/logr"
|
||||||
"github.com/wiggin77/logr/format"
|
"github.com/wiggin77/logr/format"
|
||||||
@@ -46,8 +47,10 @@ func (a *Audit) MakeFilter(level ...Level) *logr.CustomFilter {
|
|||||||
func (a *Audit) MakeJSONFormatter() *format.JSON {
|
func (a *Audit) MakeJSONFormatter() *format.JSON {
|
||||||
f := &format.JSON{
|
f := &format.JSON{
|
||||||
DisableTimestamp: true,
|
DisableTimestamp: true,
|
||||||
|
DisableMsg: true,
|
||||||
DisableStacktrace: true,
|
DisableStacktrace: true,
|
||||||
DisableLevel: true,
|
DisableLevel: true,
|
||||||
|
ContextSorter: sortAuditFields,
|
||||||
}
|
}
|
||||||
return f
|
return f
|
||||||
}
|
}
|
||||||
@@ -117,3 +120,56 @@ func (a *Audit) onLoggerError(err error) {
|
|||||||
a.OnError(err)
|
a.OnError(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// sortAuditFields sorts the context fields of an audit record such that some fields
|
||||||
|
// are prepended in order, some are appended in order, and the rest are sorted alphabetically.
|
||||||
|
// This is done to make reading the records easier since common fields will appear in the same order.
|
||||||
|
func sortAuditFields(fields logr.Fields) []format.ContextField {
|
||||||
|
prependKeys := []string{KeyEvent, KeyStatus, KeyUserID, KeySessionID, KeyIPAddress}
|
||||||
|
appendKeys := []string{KeyClusterID, KeyClient}
|
||||||
|
|
||||||
|
// sort alphabetically any fields not in the prepend/append lists.
|
||||||
|
keys := make([]string, 0, len(fields))
|
||||||
|
for k := range fields {
|
||||||
|
if !findIn(k, prependKeys, appendKeys) {
|
||||||
|
keys = append(keys, k)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sort.Strings(keys)
|
||||||
|
|
||||||
|
allKeys := make([]string, 0, len(fields))
|
||||||
|
|
||||||
|
// add any prepends that exist in fields
|
||||||
|
for _, k := range prependKeys {
|
||||||
|
if _, ok := fields[k]; ok {
|
||||||
|
allKeys = append(allKeys, k)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// sorted
|
||||||
|
allKeys = append(allKeys, keys...)
|
||||||
|
|
||||||
|
// add any appends that exist in fields
|
||||||
|
for _, k := range appendKeys {
|
||||||
|
if _, ok := fields[k]; ok {
|
||||||
|
allKeys = append(allKeys, k)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cfs := make([]format.ContextField, 0, len(allKeys))
|
||||||
|
for _, k := range allKeys {
|
||||||
|
cfs = append(cfs, format.ContextField{Key: k, Val: fields[k]})
|
||||||
|
}
|
||||||
|
return cfs
|
||||||
|
}
|
||||||
|
|
||||||
|
func findIn(s string, arrs ...[]string) bool {
|
||||||
|
for _, list := range arrs {
|
||||||
|
for _, key := range list {
|
||||||
|
if s == key {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|||||||
67
audit/audit_test.go
Обычный файл
67
audit/audit_test.go
Обычный файл
@@ -0,0 +1,67 @@
|
|||||||
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||||
|
// See LICENSE.txt for license information.
|
||||||
|
|
||||||
|
package audit
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
|
"github.com/wiggin77/logr"
|
||||||
|
"github.com/wiggin77/logr/format"
|
||||||
|
)
|
||||||
|
|
||||||
|
func Test_sortAuditFields(t *testing.T) {
|
||||||
|
type args struct {
|
||||||
|
fields logr.Fields
|
||||||
|
}
|
||||||
|
tests := []struct {
|
||||||
|
name string
|
||||||
|
args args
|
||||||
|
want []format.ContextField
|
||||||
|
}{
|
||||||
|
{name: "empty list",
|
||||||
|
args: args{fields: logr.Fields{}},
|
||||||
|
want: []format.ContextField{},
|
||||||
|
},
|
||||||
|
{name: "partial list",
|
||||||
|
args: args{fields: logr.Fields{"zProp": "x", "xProp": "x", "yProp": "x", KeyClusterID: "x", KeyEvent: "x"}},
|
||||||
|
want: []format.ContextField{
|
||||||
|
{Key: KeyEvent, Val: "x"},
|
||||||
|
{Key: "xProp", Val: "x"},
|
||||||
|
{Key: "yProp", Val: "x"},
|
||||||
|
{Key: "zProp", Val: "x"},
|
||||||
|
{Key: KeyClusterID, Val: "x"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{name: "append/prepend only list",
|
||||||
|
args: args{fields: logr.Fields{KeyClusterID: "x", KeyEvent: "x", KeySessionID: "x", KeyIPAddress: "x", KeyClient: "x",
|
||||||
|
KeyUserID: "x", KeyStatus: "x"}},
|
||||||
|
want: []format.ContextField{
|
||||||
|
// prepend: KeyEvent, KeyStatus, KeyUserID, KeySessionID, KeyIPAddress
|
||||||
|
// append: KeyClusterID, KeyClient
|
||||||
|
{Key: KeyEvent, Val: "x"},
|
||||||
|
{Key: KeyStatus, Val: "x"},
|
||||||
|
{Key: KeyUserID, Val: "x"},
|
||||||
|
{Key: KeySessionID, Val: "x"},
|
||||||
|
{Key: KeyIPAddress, Val: "x"},
|
||||||
|
{Key: KeyClusterID, Val: "x"},
|
||||||
|
{Key: KeyClient, Val: "x"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{name: "sortables only list",
|
||||||
|
args: args{fields: logr.Fields{"zProp": "x", "xProp": "x", "yProp": "x"}},
|
||||||
|
want: []format.ContextField{
|
||||||
|
{Key: "xProp", Val: "x"},
|
||||||
|
{Key: "yProp", Val: "x"},
|
||||||
|
{Key: "zProp", Val: "x"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
for _, tt := range tests {
|
||||||
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
got := sortAuditFields(tt.args.fields)
|
||||||
|
require.Equal(t, tt.want, got)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,6 +13,7 @@ const (
|
|||||||
KeySessionID = "session_id"
|
KeySessionID = "session_id"
|
||||||
KeyClient = "client"
|
KeyClient = "client"
|
||||||
KeyIPAddress = "ip_address"
|
KeyIPAddress = "ip_address"
|
||||||
|
KeyClusterID = "cluster_id"
|
||||||
|
|
||||||
Success = "success"
|
Success = "success"
|
||||||
Attempt = "attempt"
|
Attempt = "attempt"
|
||||||
|
|||||||
34
audit/file.go
Обычный файл
34
audit/file.go
Обычный файл
@@ -0,0 +1,34 @@
|
|||||||
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||||
|
// See LICENSE.txt for license information.
|
||||||
|
|
||||||
|
package audit
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"github.com/wiggin77/logr"
|
||||||
|
"github.com/wiggin77/logr/target"
|
||||||
|
)
|
||||||
|
|
||||||
|
type FileOptions target.FileOptions
|
||||||
|
|
||||||
|
// NewFileTarget creates a target capable of outputting log records to a rotated file.
|
||||||
|
func NewFileTarget(filter logr.Filter, formatter logr.Formatter, opts FileOptions, maxQSize int) (*target.File, error) {
|
||||||
|
fopts := target.FileOptions(opts)
|
||||||
|
err := checkFileWritable(fopts.Filename)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
target := target.NewFileTarget(filter, formatter, fopts, maxQSize)
|
||||||
|
return target, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func checkFileWritable(filename string) error {
|
||||||
|
// try opening/creating the file for writing
|
||||||
|
file, err := os.OpenFile(filename, os.O_RDWR|os.O_APPEND|os.O_CREATE, 0600)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
file.Close()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
2
go.mod
2
go.mod
@@ -90,7 +90,7 @@ require (
|
|||||||
github.com/tylerb/graceful v1.2.15
|
github.com/tylerb/graceful v1.2.15
|
||||||
github.com/uber/jaeger-client-go v2.22.1+incompatible
|
github.com/uber/jaeger-client-go v2.22.1+incompatible
|
||||||
github.com/uber/jaeger-lib v2.2.0+incompatible
|
github.com/uber/jaeger-lib v2.2.0+incompatible
|
||||||
github.com/wiggin77/logr v1.0.3
|
github.com/wiggin77/logr v1.0.4
|
||||||
github.com/wiggin77/merror v1.0.2
|
github.com/wiggin77/merror v1.0.2
|
||||||
github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c // indirect
|
github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c // indirect
|
||||||
github.com/ziutek/mymysql v1.5.4 // indirect
|
github.com/ziutek/mymysql v1.5.4 // indirect
|
||||||
|
|||||||
6
go.sum
6
go.sum
@@ -335,8 +335,6 @@ github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a
|
|||||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ=
|
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ=
|
||||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8=
|
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8=
|
||||||
github.com/ngdinhtoan/glide-cleanup v0.2.0/go.mod h1:UQzsmiDOb8YV3nOsCxK/c9zPpCZVNoHScRE3EO9pVMM=
|
github.com/ngdinhtoan/glide-cleanup v0.2.0/go.mod h1:UQzsmiDOb8YV3nOsCxK/c9zPpCZVNoHScRE3EO9pVMM=
|
||||||
github.com/nsf/jsondiff v0.0.0-20190712045011-8443391ee9b6 h1:qsqscDgSJy+HqgMTR+3NwjYJBbp1+honwDsszLoS+pA=
|
|
||||||
github.com/nsf/jsondiff v0.0.0-20190712045011-8443391ee9b6/go.mod h1:uFMI8w+ref4v2r9jz+c9i1IfIttS/OkmLfrk1jne5hs=
|
|
||||||
github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw=
|
github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw=
|
||||||
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
|
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
|
||||||
github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA=
|
github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA=
|
||||||
@@ -507,8 +505,8 @@ github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49u
|
|||||||
github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM=
|
github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM=
|
||||||
github.com/wiggin77/cfg v1.0.2 h1:NBUX+iJRr+RTncTqTNvajHwzduqbhCQjEqxLHr6Fk7A=
|
github.com/wiggin77/cfg v1.0.2 h1:NBUX+iJRr+RTncTqTNvajHwzduqbhCQjEqxLHr6Fk7A=
|
||||||
github.com/wiggin77/cfg v1.0.2/go.mod h1:b3gotba2e5bXTqTW48DwIFoLc+4lWKP7WPi/CdvZ4aE=
|
github.com/wiggin77/cfg v1.0.2/go.mod h1:b3gotba2e5bXTqTW48DwIFoLc+4lWKP7WPi/CdvZ4aE=
|
||||||
github.com/wiggin77/logr v1.0.3 h1:4Cj899GZJInB9vudlxsmLRDsBlsw9pE/nyJo9XZ/yzo=
|
github.com/wiggin77/logr v1.0.4 h1:g8YO5AU9hhKvLQnXceP8/y3JJtw3wPKL4kTzMTUdN5k=
|
||||||
github.com/wiggin77/logr v1.0.3/go.mod h1:oIvnsSkyTQojUsr7QO0d4rE2afZbsTj/5WbiikGJu3E=
|
github.com/wiggin77/logr v1.0.4/go.mod h1:h98FF6GPfThhDrHCg063hZA1sIyOEzQ/P85wgqI0IqE=
|
||||||
github.com/wiggin77/merror v1.0.2 h1:V0nH9eFp64ASyaXC+pB5WpvBoCg7NUwvaCSKdzlcHqw=
|
github.com/wiggin77/merror v1.0.2 h1:V0nH9eFp64ASyaXC+pB5WpvBoCg7NUwvaCSKdzlcHqw=
|
||||||
github.com/wiggin77/merror v1.0.2/go.mod h1:uQTcIU0Z6jRK4OwqganPYerzQxSFJ4GSHM3aurxxQpg=
|
github.com/wiggin77/merror v1.0.2/go.mod h1:uQTcIU0Z6jRK4OwqganPYerzQxSFJ4GSHM3aurxxQpg=
|
||||||
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
|
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
|
||||||
|
|||||||
@@ -1061,42 +1061,78 @@ func (s *LogSettings) SetDefaults() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ExperimentalAuditSettings struct {
|
type ExperimentalAuditSettings struct {
|
||||||
Enabled *bool `restricted:"true"`
|
SysLogEnabled *bool `restricted:"true"`
|
||||||
IP *string `restricted:"true"`
|
SysLogIP *string `restricted:"true"`
|
||||||
Port *int `restricted:"true"`
|
SysLogPort *int `restricted:"true"`
|
||||||
Tag *string `restricted:"true"`
|
SysLogTag *string `restricted:"true"`
|
||||||
Cert *string `restricted:"true"`
|
SysLogCert *string `restricted:"true"`
|
||||||
Insecure *bool `restricted:"true"`
|
SysLogInsecure *bool `restricted:"true"`
|
||||||
MaxQSize *int `restricted:"true"`
|
SysLogMaxQueueSize *int `restricted:"true"`
|
||||||
|
|
||||||
|
FileEnabled *bool `restricted:"true"`
|
||||||
|
FileName *string `restricted:"true"`
|
||||||
|
FileMaxSizeMB *int `restricted:"true"`
|
||||||
|
FileMaxAgeDays *int `restricted:"true"`
|
||||||
|
FileMaxBackups *int `restricted:"true"`
|
||||||
|
FileCompress *bool `restricted:"true"`
|
||||||
|
FileMaxQueueSize *int `restricted:"true"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ExperimentalAuditSettings) SetDefaults() {
|
func (s *ExperimentalAuditSettings) SetDefaults() {
|
||||||
if s.Enabled == nil {
|
if s.SysLogEnabled == nil {
|
||||||
s.Enabled = NewBool(false)
|
s.SysLogEnabled = NewBool(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
if s.IP == nil {
|
if s.SysLogIP == nil {
|
||||||
s.IP = NewString("localhost")
|
s.SysLogIP = NewString("localhost")
|
||||||
}
|
}
|
||||||
|
|
||||||
if s.Port == nil {
|
if s.SysLogPort == nil {
|
||||||
s.Port = NewInt(6514)
|
s.SysLogPort = NewInt(6514)
|
||||||
}
|
}
|
||||||
|
|
||||||
if s.Tag == nil {
|
if s.SysLogTag == nil {
|
||||||
s.Tag = NewString("")
|
s.SysLogTag = NewString("")
|
||||||
}
|
}
|
||||||
|
|
||||||
if s.Cert == nil {
|
if s.SysLogCert == nil {
|
||||||
s.Cert = NewString("")
|
s.SysLogCert = NewString("")
|
||||||
}
|
}
|
||||||
|
|
||||||
if s.Insecure == nil {
|
if s.SysLogInsecure == nil {
|
||||||
s.Insecure = NewBool(false)
|
s.SysLogInsecure = NewBool(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
if s.MaxQSize == nil {
|
if s.SysLogMaxQueueSize == nil {
|
||||||
s.MaxQSize = NewInt(1000)
|
s.SysLogMaxQueueSize = NewInt(1000)
|
||||||
|
}
|
||||||
|
|
||||||
|
if s.FileEnabled == nil {
|
||||||
|
s.FileEnabled = NewBool(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
if s.FileName == nil {
|
||||||
|
s.FileName = NewString("")
|
||||||
|
}
|
||||||
|
|
||||||
|
if s.FileMaxSizeMB == nil {
|
||||||
|
s.FileMaxSizeMB = NewInt(100)
|
||||||
|
}
|
||||||
|
|
||||||
|
if s.FileMaxAgeDays == nil {
|
||||||
|
s.FileMaxAgeDays = NewInt(0) // no limit on age
|
||||||
|
}
|
||||||
|
|
||||||
|
if s.FileMaxBackups == nil { // no limit on number of backups
|
||||||
|
s.FileMaxBackups = NewInt(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
if s.FileCompress == nil {
|
||||||
|
s.FileCompress = NewBool(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
if s.FileMaxQueueSize == nil {
|
||||||
|
s.FileMaxQueueSize = NewInt(1000)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
70
vendor/github.com/shinji62/logrus-syslog-ng/README.md
сгенерированный
поставляемый
70
vendor/github.com/shinji62/logrus-syslog-ng/README.md
сгенерированный
поставляемый
@@ -1,70 +0,0 @@
|
|||||||
# Syslog Hooks for Logrus supporting TLS <img src="http://i.imgur.com/hTeVwmJ.png" width="40" height="40" alt=":walrus:" class="emoji" title=":walrus:"/>
|
|
||||||
|
|
||||||
## Description
|
|
||||||
|
|
||||||
Simple drop-in replacement for the default hook for syslog.
|
|
||||||
|
|
||||||
Adding support for TLS and using https://github.com/RackSec/srslog instead of go default `log/syslog` lib.
|
|
||||||
|
|
||||||
|
|
||||||
## Usage for tls
|
|
||||||
|
|
||||||
Only tcp+tls protocol is supported in this case
|
|
||||||
|
|
||||||
```go
|
|
||||||
import (
|
|
||||||
syslog "github.com/RackSec/srslog"
|
|
||||||
"github.com/Sirupsen/logrus"
|
|
||||||
logrus_syslog "github.com/shinji62/logrus-syslog-ng"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
log := logrus.New()
|
|
||||||
hook, err := logrus_syslog.NewSyslogHookTLS("localhost:514", syslog.LOG_INFO, "tag","./mycert.pem")
|
|
||||||
|
|
||||||
if err == nil {
|
|
||||||
log.Hooks.Add(hook)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
## Usage without TLS
|
|
||||||
|
|
||||||
Tcp, udp are supported
|
|
||||||
|
|
||||||
```go
|
|
||||||
import (
|
|
||||||
syslog "github.com/RackSec/srslog"
|
|
||||||
"github.com/Sirupsen/logrus"
|
|
||||||
logrus_syslog "github.com/shinji62/logrus-syslog-ng"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
log := logrus.New()
|
|
||||||
hook, err := logrus_syslog.NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, "")
|
|
||||||
|
|
||||||
if err == nil {
|
|
||||||
log.Hooks.Add(hook)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
If you want to connect to local syslog (Ex. "/dev/log" or "/var/run/syslog" or "/var/run/log"). Just assign empty string to the first two parameters of `NewSyslogHook`. It should look like the following.
|
|
||||||
|
|
||||||
```go
|
|
||||||
import (
|
|
||||||
syslog "github.com/RackSec/srslog"
|
|
||||||
"github.com/Sirupsen/logrus"
|
|
||||||
logrus_syslog "github.com/shinji62/logrus-syslog-ng"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
log := logrus.New()
|
|
||||||
hook, err := logrus_syslog.NewSyslogHook("", "", syslog.LOG_INFO, "")
|
|
||||||
|
|
||||||
if err == nil {
|
|
||||||
log.Hooks.Add(hook)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
49
vendor/github.com/shinji62/logrus-syslog-ng/glide.lock
сгенерированный
поставляемый
49
vendor/github.com/shinji62/logrus-syslog-ng/glide.lock
сгенерированный
поставляемый
@@ -1,49 +0,0 @@
|
|||||||
hash: ab89e9ad4cf3394d549643bff7095cf5a161a19390b75e66515732863bf4c77d
|
|
||||||
updated: 2017-09-21T14:10:21.771379602+09:00
|
|
||||||
imports:
|
|
||||||
- name: github.com/onsi/ginkgo
|
|
||||||
version: 00054c0bb96fc880d4e0be1b90937fad438c5290
|
|
||||||
subpackages:
|
|
||||||
- config
|
|
||||||
- internal/codelocation
|
|
||||||
- internal/containernode
|
|
||||||
- internal/failer
|
|
||||||
- internal/leafnodes
|
|
||||||
- internal/remote
|
|
||||||
- internal/spec
|
|
||||||
- internal/specrunner
|
|
||||||
- internal/suite
|
|
||||||
- internal/testingtproxy
|
|
||||||
- internal/writer
|
|
||||||
- reporters
|
|
||||||
- reporters/stenographer
|
|
||||||
- reporters/stenographer/support/go-colorable
|
|
||||||
- reporters/stenographer/support/go-isatty
|
|
||||||
- types
|
|
||||||
- name: github.com/onsi/gomega
|
|
||||||
version: 4dfabf7db2e4147ec99a86db32b2f2a3484cfee8
|
|
||||||
subpackages:
|
|
||||||
- format
|
|
||||||
- internal/assertion
|
|
||||||
- internal/asyncassertion
|
|
||||||
- internal/testingtsupport
|
|
||||||
- matchers
|
|
||||||
- matchers/support/goraph/bipartitegraph
|
|
||||||
- matchers/support/goraph/edge
|
|
||||||
- matchers/support/goraph/node
|
|
||||||
- matchers/support/goraph/util
|
|
||||||
- types
|
|
||||||
- name: github.com/RackSec/srslog
|
|
||||||
version: a974ba6f7fb527d2ddc73ee9c05d3e2ccc0af0dc
|
|
||||||
- name: github.com/sirupsen/logrus
|
|
||||||
version: 89742aefa4b206dcf400792f3bd35b542998eb3b
|
|
||||||
- name: golang.org/x/crypto
|
|
||||||
version: 7d9177d70076375b9a59c8fde23d52d9c4a7ecd5
|
|
||||||
subpackages:
|
|
||||||
- ssh/terminal
|
|
||||||
- name: golang.org/x/sys
|
|
||||||
version: d75a52659825e75fff6158388dddc6a5b04f9ba5
|
|
||||||
subpackages:
|
|
||||||
- unix
|
|
||||||
- windows
|
|
||||||
testImports: []
|
|
||||||
45
vendor/github.com/shinji62/logrus-syslog-ng/glide.yaml
сгенерированный
поставляемый
45
vendor/github.com/shinji62/logrus-syslog-ng/glide.yaml
сгенерированный
поставляемый
@@ -1,45 +0,0 @@
|
|||||||
package: github.com/shinji62/logrus-syslog-ng
|
|
||||||
import:
|
|
||||||
- package: github.com/RackSec/srslog
|
|
||||||
version: a974ba6f7fb527d2ddc73ee9c05d3e2ccc0af0dc
|
|
||||||
- package: github.com/sirupsen/logrus
|
|
||||||
version: 89742aefa4b206dcf400792f3bd35b542998eb3b
|
|
||||||
- package: github.com/onsi/ginkgo
|
|
||||||
version: 00054c0bb96fc880d4e0be1b90937fad438c5290
|
|
||||||
subpackages:
|
|
||||||
- config
|
|
||||||
- internal/codelocation
|
|
||||||
- internal/containernode
|
|
||||||
- internal/failer
|
|
||||||
- internal/leafnodes
|
|
||||||
- internal/remote
|
|
||||||
- internal/spec
|
|
||||||
- internal/specrunner
|
|
||||||
- internal/suite
|
|
||||||
- internal/testingtproxy
|
|
||||||
- internal/writer
|
|
||||||
- reporters
|
|
||||||
- reporters/stenographer
|
|
||||||
- reporters/stenographer/support/go-colorable
|
|
||||||
- reporters/stenographer/support/go-isatty
|
|
||||||
- types
|
|
||||||
- package: github.com/onsi/gomega
|
|
||||||
version: 4dfabf7db2e4147ec99a86db32b2f2a3484cfee8
|
|
||||||
subpackages:
|
|
||||||
- format
|
|
||||||
- internal/assertion
|
|
||||||
- internal/asyncassertion
|
|
||||||
- internal/testingtsupport
|
|
||||||
- matchers
|
|
||||||
- matchers/support/goraph/bipartitegraph
|
|
||||||
- matchers/support/goraph/edge
|
|
||||||
- matchers/support/goraph/node
|
|
||||||
- matchers/support/goraph/util
|
|
||||||
- types
|
|
||||||
- package: golang.org/x/sys
|
|
||||||
version: d75a52659825e75fff6158388dddc6a5b04f9ba5
|
|
||||||
subpackages:
|
|
||||||
- unix
|
|
||||||
- package: golang.org/x/crypto
|
|
||||||
subpackages:
|
|
||||||
- ssh/terminal
|
|
||||||
75
vendor/github.com/shinji62/logrus-syslog-ng/syslog.go
сгенерированный
поставляемый
75
vendor/github.com/shinji62/logrus-syslog-ng/syslog.go
сгенерированный
поставляемый
@@ -1,75 +0,0 @@
|
|||||||
// +build !windows,!nacl,!plan9
|
|
||||||
|
|
||||||
package logrus_syslog
|
|
||||||
|
|
||||||
import (
|
|
||||||
"crypto/tls"
|
|
||||||
"crypto/x509"
|
|
||||||
"fmt"
|
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
|
||||||
|
|
||||||
syslog "github.com/RackSec/srslog"
|
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
|
||||||
SecureProto = "tcp+tls"
|
|
||||||
)
|
|
||||||
|
|
||||||
// SyslogHook to send logs via syslog.
|
|
||||||
type SyslogHook struct {
|
|
||||||
Writer *syslog.Writer
|
|
||||||
}
|
|
||||||
|
|
||||||
// Creates a hook to be added to an instance of logger. This is called with
|
|
||||||
// `hook, err := NewSyslogHook("udp", "localhost:514", syslog.LOG_DEBUG, "")`
|
|
||||||
// `if err == nil { log.Hooks.Add(hook) }`
|
|
||||||
func NewSyslogHook(network, raddr string, priority syslog.Priority, tag string) (*SyslogHook, error) {
|
|
||||||
w, err := syslog.Dial(network, raddr, priority, tag)
|
|
||||||
return &SyslogHook{w}, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewSyslogHookTls(raddr string, priority syslog.Priority, tag string, certPath string, insecure bool) (*SyslogHook, error) {
|
|
||||||
serverCert, err := ioutil.ReadFile(certPath)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
pool := x509.NewCertPool()
|
|
||||||
pool.AppendCertsFromPEM(serverCert)
|
|
||||||
config := tls.Config{
|
|
||||||
RootCAs: pool,
|
|
||||||
}
|
|
||||||
config.InsecureSkipVerify = insecure
|
|
||||||
w, err := syslog.DialWithTLSConfig(SecureProto, raddr, priority, tag, &config)
|
|
||||||
return &SyslogHook{w}, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func (hook *SyslogHook) Fire(entry *logrus.Entry) error {
|
|
||||||
line, err := entry.String()
|
|
||||||
if err != nil {
|
|
||||||
fmt.Fprintf(os.Stderr, "Unable to read entry, %v", err)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
switch entry.Level {
|
|
||||||
case logrus.PanicLevel:
|
|
||||||
return hook.Writer.Crit(line)
|
|
||||||
case logrus.FatalLevel:
|
|
||||||
return hook.Writer.Crit(line)
|
|
||||||
case logrus.ErrorLevel:
|
|
||||||
return hook.Writer.Err(line)
|
|
||||||
case logrus.WarnLevel:
|
|
||||||
return hook.Writer.Warning(line)
|
|
||||||
case logrus.InfoLevel:
|
|
||||||
return hook.Writer.Info(line)
|
|
||||||
case logrus.DebugLevel:
|
|
||||||
return hook.Writer.Debug(line)
|
|
||||||
default:
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (hook *SyslogHook) Levels() []logrus.Level {
|
|
||||||
return logrus.AllLevels
|
|
||||||
}
|
|
||||||
4
vendor/github.com/wiggin77/logr/const.go
сгенерированный
поставляемый
4
vendor/github.com/wiggin77/logr/const.go
сгенерированный
поставляемый
@@ -11,6 +11,10 @@ const (
|
|||||||
// when generating stack traces for logging.
|
// when generating stack traces for logging.
|
||||||
DefaultMaxStackFrames = 30
|
DefaultMaxStackFrames = 30
|
||||||
|
|
||||||
|
// MaxLevelID is the maximum value of a level ID. Some level cache implementations will
|
||||||
|
// allocate a cache of this size. Cannot exceed uint.
|
||||||
|
MaxLevelID = 256
|
||||||
|
|
||||||
// DefaultEnqueueTimeout is the default amount of time a log record can take to be queued.
|
// DefaultEnqueueTimeout is the default amount of time a log record can take to be queued.
|
||||||
// This only applies to blocking enqueue which happen after `logr.OnQueueFull` is called
|
// This only applies to blocking enqueue which happen after `logr.OnQueueFull` is called
|
||||||
// and returns false.
|
// and returns false.
|
||||||
|
|||||||
2
vendor/github.com/wiggin77/logr/filter.go
сгенерированный
поставляемый
2
vendor/github.com/wiggin77/logr/filter.go
сгенерированный
поставляемый
@@ -1,7 +1,7 @@
|
|||||||
package logr
|
package logr
|
||||||
|
|
||||||
// LevelID is the unique id of each level.
|
// LevelID is the unique id of each level.
|
||||||
type LevelID uint8
|
type LevelID uint
|
||||||
|
|
||||||
// Level provides a mechanism to enable/disable specific log lines.
|
// Level provides a mechanism to enable/disable specific log lines.
|
||||||
type Level struct {
|
type Level struct {
|
||||||
|
|||||||
54
vendor/github.com/wiggin77/logr/format/json.go
сгенерированный
поставляемый
54
vendor/github.com/wiggin77/logr/format/json.go
сгенерированный
поставляемый
@@ -4,6 +4,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"sort"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -11,6 +12,12 @@ import (
|
|||||||
"github.com/wiggin77/logr"
|
"github.com/wiggin77/logr"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// ContextField is a name/value pair within the context fields.
|
||||||
|
type ContextField struct {
|
||||||
|
Key string
|
||||||
|
Val interface{}
|
||||||
|
}
|
||||||
|
|
||||||
// JSON formats log records as JSON.
|
// JSON formats log records as JSON.
|
||||||
type JSON struct {
|
type JSON struct {
|
||||||
// DisableTimestamp disables output of timestamp field.
|
// DisableTimestamp disables output of timestamp field.
|
||||||
@@ -28,8 +35,7 @@ type JSON struct {
|
|||||||
// then DefTimestampFormat is used.
|
// then DefTimestampFormat is used.
|
||||||
TimestampFormat string
|
TimestampFormat string
|
||||||
|
|
||||||
// Indent sets the character used to indent or pretty print the JSON.
|
// Deprecated: this has no effect.
|
||||||
// Empty string means no pretty print.
|
|
||||||
Indent string
|
Indent string
|
||||||
|
|
||||||
// EscapeHTML determines if certain characters (e.g. `<`, `>`, `&`)
|
// EscapeHTML determines if certain characters (e.g. `<`, `>`, `&`)
|
||||||
@@ -52,6 +58,9 @@ type JSON struct {
|
|||||||
// KeyStacktrace overrides the stacktrace field key name.
|
// KeyStacktrace overrides the stacktrace field key name.
|
||||||
KeyStacktrace string
|
KeyStacktrace string
|
||||||
|
|
||||||
|
// ContextSorter allows custom sorting for the context fields.
|
||||||
|
ContextSorter func(fields logr.Fields) []ContextField
|
||||||
|
|
||||||
once sync.Once
|
once sync.Once
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,16 +76,23 @@ func (j *JSON) Format(rec *logr.LogRec, stacktrace bool, buf *bytes.Buffer) (*by
|
|||||||
enc.Release()
|
enc.Release()
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
sorter := j.ContextSorter
|
||||||
|
if sorter == nil {
|
||||||
|
sorter = j.defaultContextSorter
|
||||||
|
}
|
||||||
|
|
||||||
jlr := JSONLogRec{
|
jlr := JSONLogRec{
|
||||||
LogRec: rec,
|
LogRec: rec,
|
||||||
JSON: j,
|
JSON: j,
|
||||||
stacktrace: stacktrace,
|
stacktrace: stacktrace,
|
||||||
|
sorter: sorter,
|
||||||
}
|
}
|
||||||
|
|
||||||
err := enc.EncodeObject(jlr)
|
err := enc.EncodeObject(jlr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
buf.WriteByte('\n')
|
||||||
return buf, nil
|
return buf, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,11 +111,27 @@ func (j *JSON) applyDefaultKeyNames() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// defaultContextSorter sorts the context fields alphabetically by key.
|
||||||
|
func (j *JSON) defaultContextSorter(fields logr.Fields) []ContextField {
|
||||||
|
keys := make([]string, 0, len(fields))
|
||||||
|
for k := range fields {
|
||||||
|
keys = append(keys, k)
|
||||||
|
}
|
||||||
|
sort.Strings(keys)
|
||||||
|
|
||||||
|
cf := make([]ContextField, 0, len(keys))
|
||||||
|
for _, k := range keys {
|
||||||
|
cf = append(cf, ContextField{Key: k, Val: fields[k]})
|
||||||
|
}
|
||||||
|
return cf
|
||||||
|
}
|
||||||
|
|
||||||
// JSONLogRec decorates a LogRec adding JSON encoding.
|
// JSONLogRec decorates a LogRec adding JSON encoding.
|
||||||
type JSONLogRec struct {
|
type JSONLogRec struct {
|
||||||
*logr.LogRec
|
*logr.LogRec
|
||||||
*JSON
|
*JSON
|
||||||
stacktrace bool
|
stacktrace bool
|
||||||
|
sorter func(fields logr.Fields) []ContextField
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalJSONObject encodes the LogRec as JSON.
|
// MarshalJSONObject encodes the LogRec as JSON.
|
||||||
@@ -119,14 +151,14 @@ func (rec JSONLogRec) MarshalJSONObject(enc *gojay.Encoder) {
|
|||||||
enc.AddStringKey(rec.KeyMsg, rec.Msg())
|
enc.AddStringKey(rec.KeyMsg, rec.Msg())
|
||||||
}
|
}
|
||||||
if !rec.DisableContext {
|
if !rec.DisableContext {
|
||||||
|
ctxFields := rec.sorter(rec.Fields())
|
||||||
if rec.KeyContextFields != "" {
|
if rec.KeyContextFields != "" {
|
||||||
enc.AddObjectKey(rec.KeyContextFields, jsonFields(rec.Fields()))
|
enc.AddObjectKey(rec.KeyContextFields, jsonFields(ctxFields))
|
||||||
} else {
|
} else {
|
||||||
m := rec.Fields()
|
if len(ctxFields) > 0 {
|
||||||
if len(m) > 0 {
|
for _, cf := range ctxFields {
|
||||||
for k, v := range m {
|
key := rec.prefixCollision(cf.Key)
|
||||||
key := rec.prefixCollision(k)
|
encodeField(enc, key, cf.Val)
|
||||||
encodeField(enc, key, v)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -180,12 +212,12 @@ func (f stackFrame) IsNil() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
type jsonFields logr.Fields
|
type jsonFields []ContextField
|
||||||
|
|
||||||
// MarshalJSONObject encodes Fields map to JSON.
|
// MarshalJSONObject encodes Fields map to JSON.
|
||||||
func (f jsonFields) MarshalJSONObject(enc *gojay.Encoder) {
|
func (f jsonFields) MarshalJSONObject(enc *gojay.Encoder) {
|
||||||
for k, v := range f {
|
for _, ctxField := range f {
|
||||||
encodeField(enc, k, v)
|
encodeField(enc, ctxField.Key, ctxField.Val)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
1
vendor/github.com/wiggin77/logr/go.mod
сгенерированный
поставляемый
1
vendor/github.com/wiggin77/logr/go.mod
сгенерированный
поставляемый
@@ -4,7 +4,6 @@ go 1.12
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/francoispqt/gojay v1.2.13
|
github.com/francoispqt/gojay v1.2.13
|
||||||
github.com/nsf/jsondiff v0.0.0-20190712045011-8443391ee9b6
|
|
||||||
github.com/wiggin77/cfg v1.0.2
|
github.com/wiggin77/cfg v1.0.2
|
||||||
github.com/wiggin77/merror v1.0.2
|
github.com/wiggin77/merror v1.0.2
|
||||||
gopkg.in/natefinch/lumberjack.v2 v2.0.0
|
gopkg.in/natefinch/lumberjack.v2 v2.0.0
|
||||||
|
|||||||
6
vendor/github.com/wiggin77/logr/go.sum
сгенерированный
поставляемый
6
vendor/github.com/wiggin77/logr/go.sum
сгенерированный
поставляемый
@@ -15,6 +15,7 @@ github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBT
|
|||||||
github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s=
|
github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s=
|
||||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||||
github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||||
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
||||||
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
|
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
|
||||||
@@ -58,10 +59,9 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ
|
|||||||
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||||
github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo=
|
github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo=
|
||||||
github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM=
|
github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM=
|
||||||
github.com/nsf/jsondiff v0.0.0-20190712045011-8443391ee9b6 h1:qsqscDgSJy+HqgMTR+3NwjYJBbp1+honwDsszLoS+pA=
|
|
||||||
github.com/nsf/jsondiff v0.0.0-20190712045011-8443391ee9b6/go.mod h1:uFMI8w+ref4v2r9jz+c9i1IfIttS/OkmLfrk1jne5hs=
|
|
||||||
github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=
|
github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=
|
||||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
||||||
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
|
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
|
||||||
@@ -93,6 +93,7 @@ github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYED
|
|||||||
github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw=
|
github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw=
|
||||||
github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE=
|
github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE=
|
||||||
github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA=
|
github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA=
|
||||||
|
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
|
||||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||||
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
|
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
|
||||||
github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU=
|
github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU=
|
||||||
@@ -157,6 +158,7 @@ google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmE
|
|||||||
google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio=
|
google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio=
|
||||||
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
|
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
|
||||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||||
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
||||||
gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8=
|
gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8=
|
||||||
|
|||||||
25
vendor/github.com/wiggin77/logr/levelcache.go
сгенерированный
поставляемый
25
vendor/github.com/wiggin77/logr/levelcache.go
сгенерированный
поставляемый
@@ -1,6 +1,7 @@
|
|||||||
package logr
|
package logr
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"sync"
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -15,7 +16,7 @@ type LevelStatus struct {
|
|||||||
type levelCache interface {
|
type levelCache interface {
|
||||||
setup()
|
setup()
|
||||||
get(id LevelID) (LevelStatus, bool)
|
get(id LevelID) (LevelStatus, bool)
|
||||||
put(id LevelID, status LevelStatus)
|
put(id LevelID, status LevelStatus) error
|
||||||
clear()
|
clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -30,25 +31,32 @@ func (c *syncMapLevelCache) setup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *syncMapLevelCache) get(id LevelID) (LevelStatus, bool) {
|
func (c *syncMapLevelCache) get(id LevelID) (LevelStatus, bool) {
|
||||||
|
if id > MaxLevelID {
|
||||||
|
return LevelStatus{}, false
|
||||||
|
}
|
||||||
s, _ := c.m.Load(id)
|
s, _ := c.m.Load(id)
|
||||||
status := s.(LevelStatus)
|
status := s.(LevelStatus)
|
||||||
return status, !status.empty
|
return status, !status.empty
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *syncMapLevelCache) put(id LevelID, status LevelStatus) {
|
func (c *syncMapLevelCache) put(id LevelID, status LevelStatus) error {
|
||||||
|
if id > MaxLevelID {
|
||||||
|
return fmt.Errorf("level id cannot exceed MaxLevelID (%d)", MaxLevelID)
|
||||||
|
}
|
||||||
c.m.Store(id, status)
|
c.m.Store(id, status)
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *syncMapLevelCache) clear() {
|
func (c *syncMapLevelCache) clear() {
|
||||||
var i LevelID
|
var i LevelID
|
||||||
for i = 0; i < 255; i++ {
|
for i = 0; i < MaxLevelID; i++ {
|
||||||
c.m.Store(i, LevelStatus{empty: true})
|
c.m.Store(i, LevelStatus{empty: true})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// arrayLevelCache using array and a mutex.
|
// arrayLevelCache using array and a mutex.
|
||||||
type arrayLevelCache struct {
|
type arrayLevelCache struct {
|
||||||
arr [256]LevelStatus
|
arr [MaxLevelID + 1]LevelStatus
|
||||||
mux sync.RWMutex
|
mux sync.RWMutex
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,6 +67,9 @@ func (c *arrayLevelCache) setup() {
|
|||||||
//var dummy = LevelStatus{}
|
//var dummy = LevelStatus{}
|
||||||
|
|
||||||
func (c *arrayLevelCache) get(id LevelID) (LevelStatus, bool) {
|
func (c *arrayLevelCache) get(id LevelID) (LevelStatus, bool) {
|
||||||
|
if id > MaxLevelID {
|
||||||
|
return LevelStatus{}, false
|
||||||
|
}
|
||||||
c.mux.RLock()
|
c.mux.RLock()
|
||||||
status := c.arr[id]
|
status := c.arr[id]
|
||||||
ok := !status.empty
|
ok := !status.empty
|
||||||
@@ -66,11 +77,15 @@ func (c *arrayLevelCache) get(id LevelID) (LevelStatus, bool) {
|
|||||||
return status, ok
|
return status, ok
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *arrayLevelCache) put(id LevelID, status LevelStatus) {
|
func (c *arrayLevelCache) put(id LevelID, status LevelStatus) error {
|
||||||
|
if id > MaxLevelID {
|
||||||
|
return fmt.Errorf("level id cannot exceed MaxLevelID (%d)", MaxLevelID)
|
||||||
|
}
|
||||||
c.mux.Lock()
|
c.mux.Lock()
|
||||||
defer c.mux.Unlock()
|
defer c.mux.Unlock()
|
||||||
|
|
||||||
c.arr[id] = status
|
c.arr[id] = status
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *arrayLevelCache) clear() {
|
func (c *arrayLevelCache) clear() {
|
||||||
|
|||||||
5
vendor/github.com/wiggin77/logr/logr.go
сгенерированный
поставляемый
5
vendor/github.com/wiggin77/logr/logr.go
сгенерированный
поставляемый
@@ -194,7 +194,10 @@ func (logr *Logr) IsLevelEnabled(lvl Level) LevelStatus {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Cache and return the result.
|
// Cache and return the result.
|
||||||
logr.lvlCache.put(lvl.ID, status)
|
if err := logr.lvlCache.put(lvl.ID, status); err != nil {
|
||||||
|
logr.OnLoggerError(err)
|
||||||
|
return LevelStatus{}
|
||||||
|
}
|
||||||
return status
|
return status
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
92
vendor/github.com/wiggin77/logr/target/file.go
сгенерированный
поставляемый
Обычный файл
92
vendor/github.com/wiggin77/logr/target/file.go
сгенерированный
поставляемый
Обычный файл
@@ -0,0 +1,92 @@
|
|||||||
|
package target
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"io"
|
||||||
|
|
||||||
|
"github.com/wiggin77/logr"
|
||||||
|
"github.com/wiggin77/merror"
|
||||||
|
"gopkg.in/natefinch/lumberjack.v2"
|
||||||
|
)
|
||||||
|
|
||||||
|
type FileOptions struct {
|
||||||
|
// Filename is the file to write logs to. Backup log files will be retained
|
||||||
|
// in the same directory. It uses <processname>-lumberjack.log in
|
||||||
|
// os.TempDir() if empty.
|
||||||
|
Filename string
|
||||||
|
|
||||||
|
// MaxSize is the maximum size in megabytes of the log file before it gets
|
||||||
|
// rotated. It defaults to 100 megabytes.
|
||||||
|
MaxSize int
|
||||||
|
|
||||||
|
// MaxAge is the maximum number of days to retain old log files based on the
|
||||||
|
// timestamp encoded in their filename. Note that a day is defined as 24
|
||||||
|
// hours and may not exactly correspond to calendar days due to daylight
|
||||||
|
// savings, leap seconds, etc. The default is not to remove old log files
|
||||||
|
// based on age.
|
||||||
|
MaxAge int
|
||||||
|
|
||||||
|
// MaxBackups is the maximum number of old log files to retain. The default
|
||||||
|
// is to retain all old log files (though MaxAge may still cause them to get
|
||||||
|
// deleted.)
|
||||||
|
MaxBackups int
|
||||||
|
|
||||||
|
// Compress determines if the rotated log files should be compressed
|
||||||
|
// using gzip. The default is not to perform compression.
|
||||||
|
Compress bool
|
||||||
|
}
|
||||||
|
|
||||||
|
// File outputs log records to a file which can be log rotated based on size or age.
|
||||||
|
// Uses `https://github.com/natefinch/lumberjack` for rotation.
|
||||||
|
type File struct {
|
||||||
|
logr.Basic
|
||||||
|
out io.WriteCloser
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewFileTarget creates a target capable of outputting log records to a rotated file.
|
||||||
|
func NewFileTarget(filter logr.Filter, formatter logr.Formatter, opts FileOptions, maxQueue int) *File {
|
||||||
|
lumber := &lumberjack.Logger{
|
||||||
|
Filename: opts.Filename,
|
||||||
|
MaxSize: opts.MaxSize,
|
||||||
|
MaxBackups: opts.MaxBackups,
|
||||||
|
MaxAge: opts.MaxAge,
|
||||||
|
Compress: opts.Compress,
|
||||||
|
}
|
||||||
|
f := &File{out: lumber}
|
||||||
|
f.Basic.Start(f, f, filter, formatter, maxQueue)
|
||||||
|
return f
|
||||||
|
}
|
||||||
|
|
||||||
|
// Write converts the log record to bytes, via the Formatter,
|
||||||
|
// and outputs to a file.
|
||||||
|
func (f *File) Write(rec *logr.LogRec) error {
|
||||||
|
_, stacktrace := f.IsLevelEnabled(rec.Level())
|
||||||
|
|
||||||
|
buf := rec.Logger().Logr().BorrowBuffer()
|
||||||
|
defer rec.Logger().Logr().ReleaseBuffer(buf)
|
||||||
|
|
||||||
|
buf, err := f.Formatter().Format(rec, stacktrace, buf)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
_, err = f.out.Write(buf.Bytes())
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Shutdown flushes any remaining log records and closes the file.
|
||||||
|
func (f *File) Shutdown(ctx context.Context) error {
|
||||||
|
errs := merror.New()
|
||||||
|
|
||||||
|
err := f.Basic.Shutdown(ctx)
|
||||||
|
errs.Append(err)
|
||||||
|
|
||||||
|
err = f.out.Close()
|
||||||
|
errs.Append(err)
|
||||||
|
|
||||||
|
return errs.ErrorOrNil()
|
||||||
|
}
|
||||||
|
|
||||||
|
// String returns a string representation of this target.
|
||||||
|
func (f *File) String() string {
|
||||||
|
return "FileTarget"
|
||||||
|
}
|
||||||
94
vendor/github.com/wiggin77/logr/target/syslog.go
сгенерированный
поставляемый
Обычный файл
94
vendor/github.com/wiggin77/logr/target/syslog.go
сгенерированный
поставляемый
Обычный файл
@@ -0,0 +1,94 @@
|
|||||||
|
// +build !windows,!nacl,!plan9
|
||||||
|
|
||||||
|
package target
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"log/syslog"
|
||||||
|
|
||||||
|
"github.com/wiggin77/logr"
|
||||||
|
"github.com/wiggin77/merror"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Syslog outputs log records to local or remote syslog.
|
||||||
|
type Syslog struct {
|
||||||
|
logr.Basic
|
||||||
|
w *syslog.Writer
|
||||||
|
}
|
||||||
|
|
||||||
|
// SyslogParams provides parameters for dialing a syslog daemon.
|
||||||
|
type SyslogParams struct {
|
||||||
|
Network string
|
||||||
|
Raddr string
|
||||||
|
Priority syslog.Priority
|
||||||
|
Tag string
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewSyslogTarget creates a target capable of outputting log records to remote or local syslog.
|
||||||
|
func NewSyslogTarget(filter logr.Filter, formatter logr.Formatter, params *SyslogParams, maxQueue int) (*Syslog, error) {
|
||||||
|
writer, err := syslog.Dial(params.Network, params.Raddr, params.Priority, params.Tag)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
s := &Syslog{w: writer}
|
||||||
|
s.Basic.Start(s, s, filter, formatter, maxQueue)
|
||||||
|
|
||||||
|
return s, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Shutdown stops processing log records after making best
|
||||||
|
// effort to flush queue.
|
||||||
|
func (s *Syslog) Shutdown(ctx context.Context) error {
|
||||||
|
errs := merror.New()
|
||||||
|
|
||||||
|
err := s.Basic.Shutdown(ctx)
|
||||||
|
errs.Append(err)
|
||||||
|
|
||||||
|
err = s.w.Close()
|
||||||
|
errs.Append(err)
|
||||||
|
|
||||||
|
return errs.ErrorOrNil()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Write converts the log record to bytes, via the Formatter,
|
||||||
|
// and outputs to syslog.
|
||||||
|
func (s *Syslog) Write(rec *logr.LogRec) error {
|
||||||
|
_, stacktrace := s.IsLevelEnabled(rec.Level())
|
||||||
|
|
||||||
|
buf := rec.Logger().Logr().BorrowBuffer()
|
||||||
|
defer rec.Logger().Logr().ReleaseBuffer(buf)
|
||||||
|
|
||||||
|
buf, err := s.Formatter().Format(rec, stacktrace, buf)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
txt := buf.String()
|
||||||
|
|
||||||
|
switch rec.Level() {
|
||||||
|
case logr.Panic, logr.Fatal:
|
||||||
|
err = s.w.Crit(txt)
|
||||||
|
case logr.Error:
|
||||||
|
err = s.w.Err(txt)
|
||||||
|
case logr.Warn:
|
||||||
|
err = s.w.Warning(txt)
|
||||||
|
case logr.Debug, logr.Trace:
|
||||||
|
err = s.w.Debug(txt)
|
||||||
|
default:
|
||||||
|
// logr.Info plus all custom levels.
|
||||||
|
err = s.w.Info(txt)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
reporter := rec.Logger().Logr().ReportError
|
||||||
|
reporter(fmt.Errorf("syslog write fail: %w", err))
|
||||||
|
// syslog writer will try to reconnect.
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// String returns a string representation of this target.
|
||||||
|
func (s *Syslog) String() string {
|
||||||
|
return "SyslogTarget"
|
||||||
|
}
|
||||||
45
vendor/github.com/wiggin77/logr/target/writer.go
сгенерированный
поставляемый
Обычный файл
45
vendor/github.com/wiggin77/logr/target/writer.go
сгенерированный
поставляемый
Обычный файл
@@ -0,0 +1,45 @@
|
|||||||
|
package target
|
||||||
|
|
||||||
|
import (
|
||||||
|
"io"
|
||||||
|
"io/ioutil"
|
||||||
|
|
||||||
|
"github.com/wiggin77/logr"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Writer outputs log records to any `io.Writer`.
|
||||||
|
type Writer struct {
|
||||||
|
logr.Basic
|
||||||
|
out io.Writer
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewWriterTarget creates a target capable of outputting log records to an io.Writer.
|
||||||
|
func NewWriterTarget(filter logr.Filter, formatter logr.Formatter, out io.Writer, maxQueue int) *Writer {
|
||||||
|
if out == nil {
|
||||||
|
out = ioutil.Discard
|
||||||
|
}
|
||||||
|
w := &Writer{out: out}
|
||||||
|
w.Basic.Start(w, w, filter, formatter, maxQueue)
|
||||||
|
return w
|
||||||
|
}
|
||||||
|
|
||||||
|
// Write converts the log record to bytes, via the Formatter,
|
||||||
|
// and outputs to the io.Writer.
|
||||||
|
func (w *Writer) Write(rec *logr.LogRec) error {
|
||||||
|
_, stacktrace := w.IsLevelEnabled(rec.Level())
|
||||||
|
|
||||||
|
buf := rec.Logger().Logr().BorrowBuffer()
|
||||||
|
defer rec.Logger().Logr().ReleaseBuffer(buf)
|
||||||
|
|
||||||
|
buf, err := w.Formatter().Format(rec, stacktrace, buf)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
_, err = w.out.Write(buf.Bytes())
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// String returns a string representation of this target.
|
||||||
|
func (w *Writer) String() string {
|
||||||
|
return "WriterTarget"
|
||||||
|
}
|
||||||
22
vendor/github.com/wiggin77/logrus4logr/.gitignore
сгенерированный
поставляемый
22
vendor/github.com/wiggin77/logrus4logr/.gitignore
сгенерированный
поставляемый
@@ -1,22 +0,0 @@
|
|||||||
# Binaries for programs and plugins
|
|
||||||
*.exe
|
|
||||||
*.exe~
|
|
||||||
*.dll
|
|
||||||
*.so
|
|
||||||
*.dylib
|
|
||||||
|
|
||||||
# Test binary, build with `go test -c`
|
|
||||||
*.test
|
|
||||||
|
|
||||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
|
||||||
*.out
|
|
||||||
|
|
||||||
# Log files
|
|
||||||
*.log
|
|
||||||
|
|
||||||
# test apps
|
|
||||||
test/cmd/textformatter/textformatter
|
|
||||||
test/cmd/nestedformatter/nestedformatter
|
|
||||||
test/cmd/fluentdformatter/fluentdformatter
|
|
||||||
test/cmd/lfshook/lfshook
|
|
||||||
test/cmd/lfshook-simple/lfshook-simple
|
|
||||||
21
vendor/github.com/wiggin77/logrus4logr/LICENSE
сгенерированный
поставляемый
21
vendor/github.com/wiggin77/logrus4logr/LICENSE
сгенерированный
поставляемый
@@ -1,21 +0,0 @@
|
|||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2019 wiggin77
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
91
vendor/github.com/wiggin77/logrus4logr/README.md
сгенерированный
поставляемый
91
vendor/github.com/wiggin77/logrus4logr/README.md
сгенерированный
поставляемый
@@ -1,91 +0,0 @@
|
|||||||
# logrus4logr
|
|
||||||
|
|
||||||
[](https://godoc.org/github.com/wiggin77/logrus4logr)
|
|
||||||
|
|
||||||
Provides adapters for using [Logrus](https://github.com/sirupsen/logrus) hooks and formatters with [Logr](https://github.com/wiggin77/logr).
|
|
||||||
|
|
||||||
While Logrus hooks and formatters can easily be modified to work directly with Logr, these adapters are provided for convenience.
|
|
||||||
|
|
||||||
## Hooks
|
|
||||||
|
|
||||||
A Logrus hook can be adapted to a Logr target. The example below uses [LFSHook](https://github.com/rifflock/lfshook).
|
|
||||||
More examples can be found [here](./test/cmd).
|
|
||||||
|
|
||||||
```go
|
|
||||||
package main
|
|
||||||
import (
|
|
||||||
"github.com/rifflock/lfshook"
|
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
"github.com/wiggin77/logr"
|
|
||||||
"github.com/wiggin77/logrus4logr"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
var lgr = &logr.Logr{}
|
|
||||||
|
|
||||||
// create a Local File System Hook (LFSHook)
|
|
||||||
pathMap := lfshook.PathMap{
|
|
||||||
logrus.InfoLevel: "./info.log",
|
|
||||||
logrus.WarnLevel: "./warn.log",
|
|
||||||
logrus.ErrorLevel: "./error.log",
|
|
||||||
}
|
|
||||||
lfsHook := lfshook.NewHook(pathMap, &logrus.JSONFormatter{})
|
|
||||||
|
|
||||||
// log severity Info or higher.
|
|
||||||
filter := &logr.StdFilter{Lvl: logr.Info}
|
|
||||||
|
|
||||||
// create adapter wrapping lfshook.
|
|
||||||
target := logrus4logr.NewAdapterTarget(filter, nil, lfsHook, 1000)
|
|
||||||
lgr.AddTarget(target)
|
|
||||||
|
|
||||||
// log stuff!
|
|
||||||
logger := lgr.NewLogger().WithField("status", "woot!")
|
|
||||||
|
|
||||||
logger.Info("I'm hooked on Logr")
|
|
||||||
logger.WithField("code", 501).Error("Request failed")
|
|
||||||
|
|
||||||
lgr.Shutdown()
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Formatters
|
|
||||||
|
|
||||||
A Logrus formatter can be used by Logr via an adapter. The example below uses Logrus' built-in TextFormatter.
|
|
||||||
More examples can be found [here](./test/cmd).
|
|
||||||
|
|
||||||
```go
|
|
||||||
package main
|
|
||||||
import (
|
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
"github.com/wiggin77/logr"
|
|
||||||
"github.com/wiggin77/logrus4logr"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
var lgr = &logr.Logr{}
|
|
||||||
|
|
||||||
// create a Logrus TextFormatter with whatever settings you prefer.
|
|
||||||
logrusFormatter := &logrus.TextFormatter{
|
|
||||||
// settings...
|
|
||||||
}
|
|
||||||
|
|
||||||
// log severity Info or higher.
|
|
||||||
filter := &logr.StdFilter{Lvl: logr.Info}
|
|
||||||
|
|
||||||
// wrap TextFormatter in Logr adapter.
|
|
||||||
formatter := &logrus4logr.FAdapter{Fmtr: logrusFormatter}
|
|
||||||
|
|
||||||
// create writer target to stdout using adapter.
|
|
||||||
var t logr.Target
|
|
||||||
t = target.NewWriterTarget(filter, formatter, os.Stdout, 1000)
|
|
||||||
lgr.AddTarget(t)
|
|
||||||
|
|
||||||
// log stuff!
|
|
||||||
logger := lgr.NewLogger().WithField("status", "woot!")
|
|
||||||
|
|
||||||
logger.Info("I'm hooked on Logr")
|
|
||||||
logger.WithField("code", 501).Error("Request failed")
|
|
||||||
|
|
||||||
lgr.Shutdown()
|
|
||||||
}
|
|
||||||
```
|
|
||||||
51
vendor/github.com/wiggin77/logrus4logr/convert.go
сгенерированный
поставляемый
51
vendor/github.com/wiggin77/logrus4logr/convert.go
сгенерированный
поставляемый
@@ -1,51 +0,0 @@
|
|||||||
package logrus4logr
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/wiggin77/logr"
|
|
||||||
|
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
)
|
|
||||||
|
|
||||||
func convertLogRec(rec *logr.LogRec, rus *logrus.Logger) *logrus.Entry {
|
|
||||||
entry := &logrus.Entry{
|
|
||||||
Logger: rus,
|
|
||||||
Data: convertFields(rec.Fields()),
|
|
||||||
Time: rec.Time(),
|
|
||||||
Level: convertLevel(rec.Level()),
|
|
||||||
//Caller: *runtime.Frame
|
|
||||||
Message: rec.Msg(),
|
|
||||||
//Buffer *bytes.Buffer
|
|
||||||
//Context context.Context
|
|
||||||
//err string
|
|
||||||
}
|
|
||||||
return entry
|
|
||||||
}
|
|
||||||
|
|
||||||
func convertLevel(lvl logr.Level) logrus.Level {
|
|
||||||
switch lvl {
|
|
||||||
case logr.Panic:
|
|
||||||
return logrus.PanicLevel
|
|
||||||
case logr.Fatal:
|
|
||||||
return logrus.FatalLevel
|
|
||||||
case logr.Error:
|
|
||||||
return logrus.ErrorLevel
|
|
||||||
case logr.Warn:
|
|
||||||
return logrus.WarnLevel
|
|
||||||
case logr.Info:
|
|
||||||
return logrus.InfoLevel
|
|
||||||
case logr.Debug:
|
|
||||||
return logrus.DebugLevel
|
|
||||||
case logr.Trace:
|
|
||||||
return logrus.TraceLevel
|
|
||||||
default:
|
|
||||||
return logrus.InfoLevel
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func convertFields(flds logr.Fields) logrus.Fields {
|
|
||||||
f := make(logrus.Fields, len(flds))
|
|
||||||
for k, v := range flds {
|
|
||||||
f[k] = v
|
|
||||||
}
|
|
||||||
return f
|
|
||||||
}
|
|
||||||
36
vendor/github.com/wiggin77/logrus4logr/formatter.go
сгенерированный
поставляемый
36
vendor/github.com/wiggin77/logrus4logr/formatter.go
сгенерированный
поставляемый
@@ -1,36 +0,0 @@
|
|||||||
package logrus4logr
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bytes"
|
|
||||||
"sync"
|
|
||||||
|
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
"github.com/wiggin77/logr"
|
|
||||||
)
|
|
||||||
|
|
||||||
// FAdapter wraps a Logrus formatter so it can be used as a Logr formatter.
|
|
||||||
type FAdapter struct {
|
|
||||||
// Fmtr is the Logrus formatter to wrap.
|
|
||||||
Fmtr logrus.Formatter
|
|
||||||
|
|
||||||
// Logger is an optional logrus.Logger instance to use instead of the default.
|
|
||||||
Logger *logrus.Logger
|
|
||||||
|
|
||||||
once sync.Once
|
|
||||||
}
|
|
||||||
|
|
||||||
// Format converts a log record to bytes using a Logrus formatter.
|
|
||||||
func (a *FAdapter) Format(rec *logr.LogRec, stacktrace bool, buf *bytes.Buffer) (*bytes.Buffer, error) {
|
|
||||||
a.once.Do(func() {
|
|
||||||
if a.Logger == nil {
|
|
||||||
a.Logger = logrus.StandardLogger()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
entry := convertLogRec(rec, a.Logger)
|
|
||||||
|
|
||||||
data, err := a.Fmtr.Format(entry)
|
|
||||||
if err == nil {
|
|
||||||
buf.Write(data)
|
|
||||||
}
|
|
||||||
return buf, err
|
|
||||||
}
|
|
||||||
15
vendor/github.com/wiggin77/logrus4logr/go.mod
сгенерированный
поставляемый
15
vendor/github.com/wiggin77/logrus4logr/go.mod
сгенерированный
поставляемый
@@ -1,15 +0,0 @@
|
|||||||
module github.com/wiggin77/logrus4logr
|
|
||||||
|
|
||||||
go 1.13
|
|
||||||
|
|
||||||
require (
|
|
||||||
github.com/Freman/eventloghook v0.0.0-20191003051739-e4d803b6b48b
|
|
||||||
github.com/antonfisher/nested-logrus-formatter v1.0.2
|
|
||||||
github.com/joonix/log v0.0.0-20190524090622-13fe31bbdd7a
|
|
||||||
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
|
|
||||||
github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5
|
|
||||||
github.com/sirupsen/logrus v1.4.2
|
|
||||||
github.com/wiggin77/logr v1.0.3
|
|
||||||
golang.org/x/sys v0.0.0-20191008105621-543471e840be
|
|
||||||
google.golang.org/genproto v0.0.0-20191007204434-a023cd5227bd // indirect
|
|
||||||
)
|
|
||||||
218
vendor/github.com/wiggin77/logrus4logr/go.sum
сгенерированный
поставляемый
218
vendor/github.com/wiggin77/logrus4logr/go.sum
сгенерированный
поставляемый
@@ -1,218 +0,0 @@
|
|||||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
|
||||||
cloud.google.com/go v0.31.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
|
||||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
|
||||||
cloud.google.com/go v0.37.0/go.mod h1:TS1dMSSfndXH133OKGwekG838Om/cQT0BUHV3HcBgoo=
|
|
||||||
dmitri.shuralyov.com/app/changes v0.0.0-20180602232624-0a106ad413e3/go.mod h1:Yl+fi1br7+Rr3LqpNJf1/uxUdtRUV+Tnj0o93V2B9MU=
|
|
||||||
dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBrvjyP0v+ecvNYvCpyZgu5/xkfAUhi6wJj28eUfSU=
|
|
||||||
dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4=
|
|
||||||
dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU=
|
|
||||||
git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
|
|
||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
|
||||||
github.com/Freman/eventloghook v0.0.0-20191003051739-e4d803b6b48b h1:IltY1fRcdIshI/c8KOdmaO8P4lBwDXHJYPymMisvvDs=
|
|
||||||
github.com/Freman/eventloghook v0.0.0-20191003051739-e4d803b6b48b/go.mod h1:VGwG8f2pQ8SAFjTSH3PEDmLdlvi0XTd7a4C4AZn+pVw=
|
|
||||||
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
|
|
||||||
github.com/antonfisher/nested-logrus-formatter v1.0.2 h1:t65eOqj0fWbOkZR2+OgmxPa0KYIwbPhKdYmseaCMIyI=
|
|
||||||
github.com/antonfisher/nested-logrus-formatter v1.0.2/go.mod h1:6WTfyWFkBc9+zyBaKIqRrg/KwMqBbodBjgbHjDz7zjA=
|
|
||||||
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
|
||||||
github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g=
|
|
||||||
github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s=
|
|
||||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
|
||||||
github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
|
||||||
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
|
||||||
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
|
|
||||||
github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk=
|
|
||||||
github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY=
|
|
||||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
|
||||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
|
||||||
github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
|
|
||||||
github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q=
|
|
||||||
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
|
||||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
|
||||||
github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E=
|
|
||||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
|
||||||
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
|
||||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
|
||||||
github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg=
|
|
||||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
|
||||||
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
|
|
||||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
|
||||||
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
|
||||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
|
||||||
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
|
|
||||||
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
|
|
||||||
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
|
||||||
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
|
||||||
github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY=
|
|
||||||
github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg=
|
|
||||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
|
||||||
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
|
|
||||||
github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
|
|
||||||
github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU=
|
|
||||||
github.com/joonix/log v0.0.0-20190524090622-13fe31bbdd7a h1:LL1gwNo4Z1LG68SaaNb8bxB+YnMSilYzytRfkF3AigE=
|
|
||||||
github.com/joonix/log v0.0.0-20190524090622-13fe31bbdd7a/go.mod h1:fS54ONkjDV71zS9CDx3V9K21gJg7byKSvI4ajuWFNJw=
|
|
||||||
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
|
||||||
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
|
||||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
|
||||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
|
|
||||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
|
||||||
github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s=
|
|
||||||
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
|
||||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
|
||||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
|
||||||
github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
|
||||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
|
||||||
github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI=
|
|
||||||
github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
|
||||||
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
|
||||||
github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4=
|
|
||||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
|
||||||
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
|
||||||
github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo=
|
|
||||||
github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM=
|
|
||||||
github.com/nsf/jsondiff v0.0.0-20190712045011-8443391ee9b6/go.mod h1:uFMI8w+ref4v2r9jz+c9i1IfIttS/OkmLfrk1jne5hs=
|
|
||||||
github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=
|
|
||||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
|
||||||
github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
|
||||||
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
|
|
||||||
github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
|
|
||||||
github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
|
||||||
github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5 h1:mZHayPoR0lNmnHyvtYjDeq0zlVHn9K/ZXoy17ylucdo=
|
|
||||||
github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5/go.mod h1:GEXHk5HgEKCvEIIrSpFI3ozzG5xOKA2DVlEX/gGnewM=
|
|
||||||
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
|
|
||||||
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
|
|
||||||
github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4/go.mod h1:XhFIlyj5a1fBNx5aJTbKoIq0mNaPvOagO+HjB3EtxrY=
|
|
||||||
github.com/shurcooL/events v0.0.0-20181021180414-410e4ca65f48/go.mod h1:5u70Mqkb5O5cxEA8nxTsgrgLehJeAw6Oc4Ab1c/P1HM=
|
|
||||||
github.com/shurcooL/github_flavored_markdown v0.0.0-20181002035957-2122de532470/go.mod h1:2dOwnU2uBioM+SGy2aZoq1f/Sd1l9OkAeAUvjSyvgU0=
|
|
||||||
github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk=
|
|
||||||
github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ=
|
|
||||||
github.com/shurcooL/gofontwoff v0.0.0-20180329035133-29b52fc0a18d/go.mod h1:05UtEgK5zq39gLST6uB0cf3NEHjETfB4Fgr3Gx5R9Vw=
|
|
||||||
github.com/shurcooL/gopherjslib v0.0.0-20160914041154-feb6d3990c2c/go.mod h1:8d3azKNyqcHP1GaQE/c6dDgjkgSx2BZ4IoEi4F1reUI=
|
|
||||||
github.com/shurcooL/highlight_diff v0.0.0-20170515013008-09bb4053de1b/go.mod h1:ZpfEhSmds4ytuByIcDnOLkTHGUI6KNqRNPDLHDk+mUU=
|
|
||||||
github.com/shurcooL/highlight_go v0.0.0-20181028180052-98c3abbbae20/go.mod h1:UDKB5a1T23gOMUJrI+uSuH0VRDStOiUVSjBTRDVBVag=
|
|
||||||
github.com/shurcooL/home v0.0.0-20181020052607-80b7ffcb30f9/go.mod h1:+rgNQw2P9ARFAs37qieuu7ohDNQ3gds9msbT2yn85sg=
|
|
||||||
github.com/shurcooL/htmlg v0.0.0-20170918183704-d01228ac9e50/go.mod h1:zPn1wHpTIePGnXSHpsVPWEktKXHr6+SS6x/IKRb7cpw=
|
|
||||||
github.com/shurcooL/httperror v0.0.0-20170206035902-86b7830d14cc/go.mod h1:aYMfkZ6DWSJPJ6c4Wwz3QtW22G7mf/PEgaB9k/ik5+Y=
|
|
||||||
github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg=
|
|
||||||
github.com/shurcooL/httpgzip v0.0.0-20180522190206-b1c53ac65af9/go.mod h1:919LwcH0M7/W4fcZ0/jy0qGght1GIhqyS/EgWGH2j5Q=
|
|
||||||
github.com/shurcooL/issues v0.0.0-20181008053335-6292fdc1e191/go.mod h1:e2qWDig5bLteJ4fwvDAc2NHzqFEthkqn7aOZAOpj+PQ=
|
|
||||||
github.com/shurcooL/issuesapp v0.0.0-20180602232740-048589ce2241/go.mod h1:NPpHK2TI7iSaM0buivtFUc9offApnI0Alt/K8hcHy0I=
|
|
||||||
github.com/shurcooL/notifications v0.0.0-20181007000457-627ab5aea122/go.mod h1:b5uSkrEVM1jQUspwbixRBhaIjIzL2xazXp6kntxYle0=
|
|
||||||
github.com/shurcooL/octicon v0.0.0-20181028054416-fa4f57f9efb2/go.mod h1:eWdoE5JD4R5UVWDucdOPg1g2fqQRq78IQa9zlOV1vpQ=
|
|
||||||
github.com/shurcooL/reactions v0.0.0-20181006231557-f2e0b4ca5b82/go.mod h1:TCR1lToEk4d2s07G3XGfz2QrgHXg4RJBvjrOozvoWfk=
|
|
||||||
github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
|
|
||||||
github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYEDaXHZDBsXlPCDqdhQuJkuw4NOtaxYe3xii4=
|
|
||||||
github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw=
|
|
||||||
github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
|
|
||||||
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
|
||||||
github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE=
|
|
||||||
github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA=
|
|
||||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
|
||||||
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
|
|
||||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
|
||||||
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
|
|
||||||
github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU=
|
|
||||||
github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM=
|
|
||||||
github.com/wiggin77/cfg v1.0.2 h1:NBUX+iJRr+RTncTqTNvajHwzduqbhCQjEqxLHr6Fk7A=
|
|
||||||
github.com/wiggin77/cfg v1.0.2/go.mod h1:b3gotba2e5bXTqTW48DwIFoLc+4lWKP7WPi/CdvZ4aE=
|
|
||||||
github.com/wiggin77/logr v0.0.0-20191008153504-baac1b801e73 h1:lRao0Wc0zDcje991m1OQzCDXDhJ2dAU2J+214tEoUdQ=
|
|
||||||
github.com/wiggin77/logr v0.0.0-20191008153504-baac1b801e73/go.mod h1:VZeJzSbyHqC3zInXnFBJZURn9rGbqlTzlO2m5wdijZ8=
|
|
||||||
github.com/wiggin77/logr v0.0.0-20191009035425-189ce7304c34 h1:XhYLDM920VmlED8oElS+0/odwPeH3qkkmlvS0VVwCPE=
|
|
||||||
github.com/wiggin77/logr v0.0.0-20191009035425-189ce7304c34/go.mod h1:VZeJzSbyHqC3zInXnFBJZURn9rGbqlTzlO2m5wdijZ8=
|
|
||||||
github.com/wiggin77/logr v0.0.0-20191011233000-e3bc20703517 h1:vdjEWflo0H1hEt2Iw9A3aqtCWx8dnUmIYstZtLsF2Hg=
|
|
||||||
github.com/wiggin77/logr v0.0.0-20191011233000-e3bc20703517/go.mod h1:9sOJ1T4F2YdtgMrMaq9I1PiTV8R6wKModG5qZH+ba/s=
|
|
||||||
github.com/wiggin77/logr v0.0.0-20191014204114-2df550845cfc h1:ZTtN7Tg+n2OAhQTy++YLQBl52pdUyOWPXTB6wjFdb5g=
|
|
||||||
github.com/wiggin77/logr v0.0.0-20191014204114-2df550845cfc/go.mod h1:9sOJ1T4F2YdtgMrMaq9I1PiTV8R6wKModG5qZH+ba/s=
|
|
||||||
github.com/wiggin77/logr v0.0.0-20200207002347-890d83b925be h1:lGz7zKuDckJCH48b4YCEV8nNOmETu6bW3CCws7/Euvc=
|
|
||||||
github.com/wiggin77/logr v0.0.0-20200207002347-890d83b925be/go.mod h1:oIvnsSkyTQojUsr7QO0d4rE2afZbsTj/5WbiikGJu3E=
|
|
||||||
github.com/wiggin77/logr v0.0.0-20200207172336-0c93e6357eb5 h1:PahhDMzc5XrJg/mgT87Aav4npUCkA5cBGyN9WQw3GVY=
|
|
||||||
github.com/wiggin77/logr v0.0.0-20200207172336-0c93e6357eb5/go.mod h1:oIvnsSkyTQojUsr7QO0d4rE2afZbsTj/5WbiikGJu3E=
|
|
||||||
github.com/wiggin77/logr v0.0.0-20200207192333-388c3fe88257 h1:SusN+cM1cWx20H9vv4N3dQUIlhfncUxLi8lokmo8ZUs=
|
|
||||||
github.com/wiggin77/logr v0.0.0-20200207192333-388c3fe88257/go.mod h1:oIvnsSkyTQojUsr7QO0d4rE2afZbsTj/5WbiikGJu3E=
|
|
||||||
github.com/wiggin77/logr v1.0.0 h1:i0hCQjlUpwBYdcu7iqf3hQCNIH9uf9Y2jbwcReNPscc=
|
|
||||||
github.com/wiggin77/logr v1.0.0/go.mod h1:oIvnsSkyTQojUsr7QO0d4rE2afZbsTj/5WbiikGJu3E=
|
|
||||||
github.com/wiggin77/logr v1.0.2 h1:zNuYJ+UABevEFhvlEi/MXGYiZgVrMmUJPPt60xmByBs=
|
|
||||||
github.com/wiggin77/logr v1.0.2/go.mod h1:oIvnsSkyTQojUsr7QO0d4rE2afZbsTj/5WbiikGJu3E=
|
|
||||||
github.com/wiggin77/logr v1.0.3 h1:4Cj899GZJInB9vudlxsmLRDsBlsw9pE/nyJo9XZ/yzo=
|
|
||||||
github.com/wiggin77/logr v1.0.3/go.mod h1:oIvnsSkyTQojUsr7QO0d4rE2afZbsTj/5WbiikGJu3E=
|
|
||||||
github.com/wiggin77/merror v1.0.2 h1:V0nH9eFp64ASyaXC+pB5WpvBoCg7NUwvaCSKdzlcHqw=
|
|
||||||
github.com/wiggin77/merror v1.0.2/go.mod h1:uQTcIU0Z6jRK4OwqganPYerzQxSFJ4GSHM3aurxxQpg=
|
|
||||||
go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA=
|
|
||||||
go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE=
|
|
||||||
golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw=
|
|
||||||
golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
|
||||||
golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
|
||||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
|
||||||
golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
|
||||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
|
||||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
|
||||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
|
||||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
|
||||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
|
||||||
golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
|
||||||
golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
|
||||||
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
|
||||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
|
||||||
golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
|
||||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
|
||||||
golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
|
||||||
golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
|
||||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
|
||||||
golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw=
|
|
||||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
||||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
||||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
||||||
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
||||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
|
||||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
|
||||||
golang.org/x/sys v0.0.0-20181029174526-d69651ed3497/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
|
||||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
|
||||||
golang.org/x/sys v0.0.0-20190316082340-a2f829d7f35f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc=
|
|
||||||
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20191008105621-543471e840be h1:QAcqgptGM8IQBC9K/RC4o+O9YmqEm0diQn9QmZw/0mU=
|
|
||||||
golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
|
||||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
|
||||||
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
|
||||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
|
||||||
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
|
||||||
golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
|
||||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
|
||||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
|
||||||
google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
|
|
||||||
google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
|
|
||||||
google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y=
|
|
||||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
|
||||||
google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
|
||||||
google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
|
||||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
|
||||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
|
||||||
google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
|
||||||
google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
|
||||||
google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg=
|
|
||||||
google.golang.org/genproto v0.0.0-20190306203927-b5d61aea6440/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
|
||||||
google.golang.org/genproto v0.0.0-20190522204451-c2c4e71fbf69 h1:4rNOqY4ULrKzS6twXa619uQgI7h9PaVd4ZhjFQ7C5zs=
|
|
||||||
google.golang.org/genproto v0.0.0-20190522204451-c2c4e71fbf69/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s=
|
|
||||||
google.golang.org/genproto v0.0.0-20191007204434-a023cd5227bd h1:84VQPzup3IpKLxuIAZjHMhVjJ8fZ4/i3yUnj3k6fUdw=
|
|
||||||
google.golang.org/genproto v0.0.0-20191007204434-a023cd5227bd/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
|
||||||
google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
|
|
||||||
google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio=
|
|
||||||
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
|
|
||||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
|
||||||
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
|
||||||
gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8=
|
|
||||||
gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
|
|
||||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
|
||||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
|
||||||
grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o=
|
|
||||||
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
|
||||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
|
||||||
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
|
||||||
sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck=
|
|
||||||
sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0=
|
|
||||||
44
vendor/github.com/wiggin77/logrus4logr/target.go
сгенерированный
поставляемый
44
vendor/github.com/wiggin77/logrus4logr/target.go
сгенерированный
поставляемый
@@ -1,44 +0,0 @@
|
|||||||
package logrus4logr
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
|
|
||||||
"github.com/wiggin77/logr"
|
|
||||||
|
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
)
|
|
||||||
|
|
||||||
// TAdapter wraps a Logrus hook allowing the hook be used as a Logr target.
|
|
||||||
// Create instances with `NewAdapterTarget`.
|
|
||||||
type TAdapter struct {
|
|
||||||
logr.Basic
|
|
||||||
hook logrus.Hook
|
|
||||||
|
|
||||||
// Logger is an optional logrus.Logger instance to use instead of the default.
|
|
||||||
Logger *logrus.Logger
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewAdapterTarget creates a target wrapper for a Logrus hook.
|
|
||||||
// If filter and/or formatter are nil then defaults will be used (Panic level; Plain formatter).
|
|
||||||
func NewAdapterTarget(filter logr.Filter, formatter logr.Formatter, hook logrus.Hook, maxQueue int) *TAdapter {
|
|
||||||
a := &TAdapter{hook: hook}
|
|
||||||
a.Basic.Start(a, a, filter, formatter, maxQueue)
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
// Write converts a log record to a Logrus entry and
|
|
||||||
// passes it to the Logrus hook.
|
|
||||||
func (a *TAdapter) Write(rec *logr.LogRec) error {
|
|
||||||
rus := a.Logger
|
|
||||||
if rus == nil {
|
|
||||||
rus = logrus.StandardLogger()
|
|
||||||
}
|
|
||||||
|
|
||||||
entry := convertLogRec(rec, rus)
|
|
||||||
return a.hook.Fire(entry)
|
|
||||||
}
|
|
||||||
|
|
||||||
// String returns the type name of the Logrus hook.
|
|
||||||
func (a *TAdapter) String() string {
|
|
||||||
return fmt.Sprintf("%T", a.hook)
|
|
||||||
}
|
|
||||||
7
vendor/modules.txt
поставляемый
7
vendor/modules.txt
поставляемый
@@ -227,8 +227,6 @@ github.com/sean-/seed
|
|||||||
github.com/segmentio/analytics-go
|
github.com/segmentio/analytics-go
|
||||||
# github.com/segmentio/backo-go v0.0.0-20160424052352-204274ad699c
|
# github.com/segmentio/backo-go v0.0.0-20160424052352-204274ad699c
|
||||||
github.com/segmentio/backo-go
|
github.com/segmentio/backo-go
|
||||||
# github.com/shinji62/logrus-syslog-ng v0.0.0-20180605090607-3974ebb047a0
|
|
||||||
github.com/shinji62/logrus-syslog-ng
|
|
||||||
# github.com/sirupsen/logrus v1.4.2
|
# github.com/sirupsen/logrus v1.4.2
|
||||||
github.com/sirupsen/logrus
|
github.com/sirupsen/logrus
|
||||||
# github.com/spf13/afero v1.2.2
|
# github.com/spf13/afero v1.2.2
|
||||||
@@ -282,11 +280,10 @@ github.com/uber/jaeger-lib/metrics
|
|||||||
github.com/wiggin77/cfg
|
github.com/wiggin77/cfg
|
||||||
github.com/wiggin77/cfg/ini
|
github.com/wiggin77/cfg/ini
|
||||||
github.com/wiggin77/cfg/timeconv
|
github.com/wiggin77/cfg/timeconv
|
||||||
# github.com/wiggin77/logr v1.0.3
|
# github.com/wiggin77/logr v1.0.4
|
||||||
github.com/wiggin77/logr
|
github.com/wiggin77/logr
|
||||||
github.com/wiggin77/logr/format
|
github.com/wiggin77/logr/format
|
||||||
# github.com/wiggin77/logrus4logr v1.0.2
|
github.com/wiggin77/logr/target
|
||||||
github.com/wiggin77/logrus4logr
|
|
||||||
# github.com/wiggin77/merror v1.0.2
|
# github.com/wiggin77/merror v1.0.2
|
||||||
github.com/wiggin77/merror
|
github.com/wiggin77/merror
|
||||||
# github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c
|
# github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c
|
||||||
|
|||||||
@@ -42,22 +42,10 @@ func (c *Context) LogAuditRecWithLevel(rec *audit.Record, level audit.Level) {
|
|||||||
}
|
}
|
||||||
rec.Fail()
|
rec.Fail()
|
||||||
}
|
}
|
||||||
c.App.Srv().Audit.LogRecord(level, *rec)
|
if cid := c.App.GetClusterId(); cid != "" {
|
||||||
}
|
rec.AddMeta(audit.KeyClusterID, cid)
|
||||||
|
|
||||||
// LogAuditMeta creates an audit record and logs it.
|
|
||||||
func (c *Context) LogAuditEx(event string, status string) {
|
|
||||||
rec := c.MakeAuditRecord(event, status)
|
|
||||||
c.LogAuditRec(rec)
|
|
||||||
}
|
|
||||||
|
|
||||||
// LogAuditMeta creates an audit record with metadata and logs it.
|
|
||||||
func (c *Context) LogAuditMeta(event string, status string, meta audit.Meta) {
|
|
||||||
rec := c.MakeAuditRecord(event, status)
|
|
||||||
if meta != nil {
|
|
||||||
rec.Meta = meta
|
|
||||||
}
|
}
|
||||||
c.LogAuditRec(rec)
|
c.App.Srv().Audit.LogRecord(level, *rec)
|
||||||
}
|
}
|
||||||
|
|
||||||
// MakeAuditRecord creates a audit record pre-populated with data from this context.
|
// MakeAuditRecord creates a audit record pre-populated with data from this context.
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user