Skip to content

Commit

Permalink
Provide flag to use zap logger
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznet committed Aug 26, 2024
1 parent b3be074 commit 3cf2cb8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions data.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ type Configuration struct {
LetsEncrypt bool `json:"lets_encrypt"` // start LetsEncrypt HTTPs server
DomainNames []string `json:"domain_names"` // list of domain names to use for LetsEncrypt

ZapLogger string `json:"zap_logger"` // define zap logger usage

// CouchDB headers, see
// https://docs.couchdb.org/en/3.1.2/api/server/authn.html#proxy-authentication
XAuthCouchDBUserName string `json:"X-Auth-CouchDB-UserName"` // X-Auth-CouchDB-UserName field of HTTP request
Expand Down
4 changes: 4 additions & 0 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ func Server(config string, port, metricsPort int, logFile string, useX509, scito
// initialize logging module
logging.CMSMonitType = Config.MonitType
logging.CMSMonitProducer = Config.MonitProducer
if Config.ZapLogger != "" {
log.Printf("Use zap logger with %s format", Config.ZapLogger)
logging.ZapLogger = Config.ZapLogger

Check failure on line 56 in server.go

View workflow job for this annotation

GitHub Actions / build

undefined: logging.ZapLogger
}

if port > 0 {
log.Println("overwrite server port number to", port)
Expand Down

0 comments on commit 3cf2cb8

Please sign in to comment.