From 1e779f71354ce9810c56e5608649ddcd6dae408c Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Fri, 21 Jun 2019 09:40:04 +0200 Subject: [PATCH] Fix some CLI bugs --- docs/content/reference/static-configuration/cli.txt | 4 +++- docs/content/reference/static-configuration/env.md | 3 +++ pkg/cli/commands.go | 2 +- pkg/config/static/static_config.go | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/content/reference/static-configuration/cli.txt b/docs/content/reference/static-configuration/cli.txt index 900c809f8..de489cb28 100644 --- a/docs/content/reference/static-configuration/cli.txt +++ b/docs/content/reference/static-configuration/cli.txt @@ -1,4 +1,3 @@ - --accesslog (Default: "false") Access log settings. @@ -173,6 +172,9 @@ --hostresolver.resolvdepth (Default: "5") The maximal depth of DNS recursive resolving +--log (Default: "false") + Traefik log settings. + --log.filepath (Default: "") Traefik log file path. Stdout is used when omitted or empty. diff --git a/docs/content/reference/static-configuration/env.md b/docs/content/reference/static-configuration/env.md index da791adb3..b9f3c67da 100644 --- a/docs/content/reference/static-configuration/env.md +++ b/docs/content/reference/static-configuration/env.md @@ -165,6 +165,9 @@ resolv.conf used for DNS resolving (Default: ```/etc/resolv.conf```) `TRAEFIK_HOSTRESOLVER_RESOLVDEPTH`: The maximal depth of DNS recursive resolving (Default: ```5```) +`TRAEFIK_LOG`: +Traefik log settings. (Default: "false") + `TRAEFIK_LOG_FILEPATH`: Traefik log file path. Stdout is used when omitted or empty. diff --git a/pkg/cli/commands.go b/pkg/cli/commands.go index e2227c12c..366abd05d 100644 --- a/pkg/cli/commands.go +++ b/pkg/cli/commands.go @@ -128,5 +128,5 @@ func contains(cmds []*Command, name string) bool { } func isFlag(arg string) bool { - return len(arg) > 0 && arg[1] == '-' + return len(arg) > 0 && arg[0] == '-' } diff --git a/pkg/config/static/static_config.go b/pkg/config/static/static_config.go index 11d50bbb0..c6ff9f4bd 100644 --- a/pkg/config/static/static_config.go +++ b/pkg/config/static/static_config.go @@ -55,7 +55,7 @@ type Configuration struct { Ping *ping.Handler `description:"Enable ping." export:"true" label:"allowEmpty"` // Rest *rest.Provider `description:"Enable Rest backend with default settings" export:"true"` - Log *types.TraefikLog `description:"Traefik log settings." export:"true"` + Log *types.TraefikLog `description:"Traefik log settings." export:"true" label:"allowEmpty"` AccessLog *types.AccessLog `description:"Access log settings." export:"true" label:"allowEmpty"` Tracing *Tracing `description:"OpenTracing configuration." export:"true" label:"allowEmpty"`