Browse Source

Logging tweaks

master
Chris Smith 5 years ago
parent
commit
e65933e339
3 changed files with 6 additions and 4 deletions
  1. 2
    0
      certs/monitor.go
  2. 3
    3
      docker/monitor.go
  3. 1
    1
      dotege.go

+ 2
- 0
certs/monitor.go View File

@@ -31,6 +31,7 @@ func (c *CertificateMonitor) AddDirectory(directory string) {
31 31
 }
32 32
 
33 33
 func (c *CertificateMonitor) scanForFolders(dir string) {
34
+	c.logger.Debugf("Scanning folder %s for certificates", dir)
34 35
 	dirs, err := ioutil.ReadDir(dir)
35 36
 	if err != nil {
36 37
 		c.logger.Errorf("Unable to read directory %s - %s", dir, err.Error())
@@ -45,6 +46,7 @@ func (c *CertificateMonitor) scanForFolders(dir string) {
45 46
 }
46 47
 
47 48
 func (c *CertificateMonitor) scanForCerts(vhost string, dir string) {
49
+	c.logger.Debugf("Scanning folder %s for certificates for %s", dir, vhost)
48 50
 	files, err := ioutil.ReadDir(dir)
49 51
 	if err != nil {
50 52
 		c.logger.Errorf("Unable to read directory %s - %s", dir, err.Error())

+ 3
- 3
docker/monitor.go View File

@@ -104,9 +104,9 @@ func (c *ContainerMonitor) scheduleExpiry(name string) {
104 104
 	now := time.Now()
105 105
 	expiryTime := now.Add(c.deletionTime)
106 106
 	c.expiryTimes[name] = expiryTime
107
-	c.logger.Info("Scheduling expiry timer for %s", name)
107
+	c.logger.Infof("Scheduling expiry timer for %s", name)
108 108
 	if c.nextExpiry.Before(now) || c.nextExpiry.After(expiryTime) {
109
-		c.logger.Debug("Starting expiry timer with default duration")
109
+		c.logger.Debugf("Starting expiry timer with default duration")
110 110
 		c.expiryTimer.Reset(c.deletionTime + 1*time.Second)
111 111
 		c.nextExpiry = expiryTime
112 112
 	}
@@ -118,7 +118,7 @@ func (c *ContainerMonitor) publishExpiredContainers() {
118 118
 
119 119
 	for name, expiryTime := range c.expiryTimes {
120 120
 		if expiryTime.Before(now) {
121
-			c.logger.Info("Expiring %s", name)
121
+			c.logger.Infof("Expiring %s", name)
122 122
 			delete(c.expiryTimes, name)
123 123
 			c.goneContainerNames <- name
124 124
 		} else if next == 0 || expiryTime.Sub(now) < next {

+ 1
- 1
dotege.go View File

@@ -60,7 +60,7 @@ func main() {
60 60
 	}
61 61
 
62 62
 	certMonitor := certs.NewCertificateManager(sugar, certChan)
63
-	certMonitor.AddDirectory("/data/certrequests/certs")
63
+	certMonitor.AddDirectory("/data/certrequests/certs/")
64 64
 	certDeployer := certs.NewCertificateDeployer(sugar, certChan)
65 65
 
66 66
 	templateGenerator := NewTemplateGenerator(sugar)

Loading…
Cancel
Save