Enable ACME library logs

This commit is contained in:
janeczku
2017-05-14 17:42:23 +02:00
parent a1425e4080
commit 8d2f8c7fdd
3 changed files with 7 additions and 5 deletions
+1 -1
View File
@@ -134,11 +134,11 @@ func (c *Context) InitContext() {
}
logrus.Infof("Using Let's Encrypt %s API", apiVersion)
c.Acme.EnableLogs()
// Enable debug mode
if c.Debug {
logrus.SetLevel(logrus.DebugLevel)
c.Acme.EnableDebug()
}
}
+5 -3
View File
@@ -149,9 +149,11 @@ func NewClient(email string, kt KeyType, apiVer ApiVersion, dnsResolvers []strin
}, nil
}
// EnableDebugLogging enables logging in the upstream lego library
func (c *Client) EnableDebug() {
lego.Logger = log.New(os.Stdout, "", 0)
// EnableLogs prints logs from the upstream lego library
func (c *Client) EnableLogs() {
logger := logrus.New()
logger.Out = os.Stdout
lego.Logger = log.New(logger.Writer(), "", 0)
}
// Issue obtains a new SAN certificate from the Lets Encrypt CA
+1 -1
View File
@@ -19,7 +19,7 @@ var (
func init() {
flag.BoolVar(&debug, "debug", false, "Enable debugging")
flag.BoolVar(&testMode, "test-mode", false, "Renew certificate every 120 seconds")
logrus.SetFormatter(&logrus.TextFormatter{DisableTimestamp: true})
// logrus.SetFormatter(&logrus.TextFormatter{DisableTimestamp: true})
logrus.SetOutput(os.Stdout)
}