Skip to content

Commit b0bbaac

Browse files
committed
Log event filters
1 parent e18f11b commit b0bbaac

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cli/docker_handler.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ func NewDockerHandler(config *Config, dockerFilters []string, configsFromLabels
6666
for _, f := range dockerFilters {
6767
key, value, err := parseFilter(f)
6868
if err != nil {
69-
config.logger.Errorf("Error parsing filter '%s': %v", f, err)
69+
logger.Errorf("Error parsing filter '%s': %v", f, err)
70+
return nil, errInvalidDockerFilter
7071
}
7172
filters[key] = append(filters[key], value)
7273
}
@@ -100,13 +101,14 @@ func (c *DockerHandler) ConfigFromLabelsEnabled() bool {
100101

101102
// Watch for Docker events and update the labels accordingly
102103
func (c *DockerHandler) watch() {
103-
c.logger.Debugf("Listening for Docker events to hot reload configs...")
104104
events := make(chan *docker.APIEvents)
105105
var filters = map[string][]string{
106106
"type": {"container"},
107107
"label": c.filters["label"],
108108
}
109109

110+
c.logger.Debugf("Listening for Docker events (with following filters %v) to hot reload configs...", filters)
111+
110112
if err := c.dockerClient.AddEventListenerWithOptions(docker.EventsOptions{
111113
Filters: filters}, events); err != nil {
112114
c.logger.Errorf("Error adding event listener: %v", err)

0 commit comments

Comments
 (0)