add experimental plugin system

This commit is contained in:
Nicola Murino
2021-07-11 15:26:51 +02:00
parent bfa4085932
commit bd5191dfc5
101 changed files with 3190 additions and 1612 deletions

View File

@@ -8,7 +8,7 @@ import (
"github.com/go-chi/chi/v5/middleware"
"github.com/rs/zerolog"
"github.com/drakkan/sftpgo/v2/metrics"
"github.com/drakkan/sftpgo/v2/metric"
)
// StructuredLogger defines a simple wrapper around zerolog logger.
@@ -56,7 +56,7 @@ func (l *StructuredLogger) NewLogEntry(r *http.Request) middleware.LogEntry {
// Write logs a new entry at the end of the HTTP request
func (l *StructuredLoggerEntry) Write(status, bytes int, header http.Header, elapsed time.Duration, extra interface{}) {
metrics.HTTPRequestServed(status)
metric.HTTPRequestServed(status)
l.Logger.Info().
Timestamp().
Str("sender", "httpd").