aboutsummaryrefslogtreecommitdiff
path: root/plugin/file/reload.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/file/reload.go')
-rw-r--r--plugin/file/reload.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/plugin/file/reload.go b/plugin/file/reload.go
index 5effae8eb..28e85b5eb 100644
--- a/plugin/file/reload.go
+++ b/plugin/file/reload.go
@@ -1,9 +1,10 @@
package file
import (
- "log"
"os"
"time"
+
+ "github.com/coredns/coredns/plugin/pkg/log"
)
// TickTime is the default time we use to reload zone. Exported to be tweaked in tests.
@@ -25,7 +26,7 @@ func (z *Zone) Reload() error {
case <-tick.C:
reader, err := os.Open(z.file)
if err != nil {
- log.Printf("[ERROR] Failed to open zone %q in %q: %v", z.origin, z.file, err)
+ log.Errorf("Failed to open zone %q in %q: %v", z.origin, z.file, err)
continue
}
@@ -33,7 +34,7 @@ func (z *Zone) Reload() error {
zone, err := Parse(reader, z.origin, z.file, serial)
if err != nil {
if _, ok := err.(*serialErr); !ok {
- log.Printf("[ERROR] Parsing zone %q: %v", z.origin, err)
+ log.Errorf("Parsing zone %q: %v", z.origin, err)
}
continue
}
@@ -44,7 +45,7 @@ func (z *Zone) Reload() error {
z.Tree = zone.Tree
z.reloadMu.Unlock()
- log.Printf("[INFO] Successfully reloaded zone %q in %q with serial %d", z.origin, z.file, z.Apex.SOA.Serial)
+ log.Infof("Successfully reloaded zone %q in %q with serial %d", z.origin, z.file, z.Apex.SOA.Serial)
z.Notify()
case <-z.reloadShutdown: