Reform logging in weaveDNS
* Put prefixes (including msg IDs) in front of log messages to distinguish them * Failed lookups get logged under Info as per issue #311 * More accurate messages as per issue #311
This commit is contained in:
1 parent
f70dfe9de8
commit
b114735a41
7 files changed
+34
-28
No files matched your search
@@ -7,7 +7,8 @@ import (
|
||||
|
||||
func checkError(err error, apiPath string) {
|
||||
if err != nil {
|
||||
Error.Fatalf("Unable to connect to Docker API on %s: %s", apiPath, err)
|
||||
Error.Fatalf("[updater] Unable to connect to Docker API on %s: %s",
|
||||
apiPath, err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +23,7 @@ func StartUpdater(apiPath string, zone Zone) error {
|
||||
err = client.AddEventListener(events)
|
||||
checkError(err, apiPath)
|
||||
|
||||
Info.Printf("Using Docker API on %s: %v", apiPath, env)
|
||||
Info.Printf("[updater] Using Docker API on %s: %v", apiPath, env)
|
||||
|
||||
go func() {
|
||||
for event := range events {
|
||||
@@ -36,7 +37,7 @@ func handleEvent(zone Zone, event *docker.APIEvents, client *docker.Client) erro
|
||||
switch event.Status {
|
||||
case "die":
|
||||
id := event.ID
|
||||
Info.Printf("Container %s down. Removing records", id)
|
||||
Info.Printf("[updater] Container %s down. Removing records", id)
|
||||
zone.DeleteRecordsFor(id)
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in new issue
Block a user