Signed-off-by: Vincent Woo <me@vincentwoo.com>
Signed-off-by: David Calavera <david.calavera@gmail.com>
| ... | ... |
@@ -666,6 +666,7 @@ __docker_subcommand() {
|
| 666 | 666 |
"($help)*--log-opt=[Log driver specific options]:log driver options:__docker_log_options" \ |
| 667 | 667 |
"($help)--mtu=[Set the containers network MTU]:mtu:(0 576 1420 1500 9000)" \ |
| 668 | 668 |
"($help -p --pidfile)"{-p=,--pidfile=}"[Path to use for daemon PID file]:PID file:_files" \
|
| 669 |
+ "($help)--raw-logs[Full timestamps without ANSI coloring]" \ |
|
| 669 | 670 |
"($help)*--registry-mirror=[Preferred Docker registry mirror]:registry mirror: " \ |
| 670 | 671 |
"($help -s --storage-driver)"{-s=,--storage-driver=}"[Storage driver to use]:driver:(aufs devicemapper btrfs zfs overlay)" \
|
| 671 | 672 |
"($help)--selinux-enabled[Enable selinux support]" \ |
| ... | ... |
@@ -39,7 +39,7 @@ script |
| 39 | 39 |
if [ -f /etc/default/$UPSTART_JOB ]; then |
| 40 | 40 |
. /etc/default/$UPSTART_JOB |
| 41 | 41 |
fi |
| 42 |
- exec "$DOCKER" daemon $DOCKER_OPTS |
|
| 42 |
+ exec "$DOCKER" daemon $DOCKER_OPTS --raw-logs |
|
| 43 | 43 |
end script |
| 44 | 44 |
|
| 45 | 45 |
# Don't emit "started" event until docker.sock is ready. |
| ... | ... |
@@ -57,6 +57,7 @@ type CommonConfig struct {
|
| 57 | 57 |
Labels []string `json:"labels,omitempty"` |
| 58 | 58 |
Mtu int `json:"mtu,omitempty"` |
| 59 | 59 |
Pidfile string `json:"pidfile,omitempty"` |
| 60 |
+ RawLogs bool `json:"raw-logs,omitempty"` |
|
| 60 | 61 |
Root string `json:"graph,omitempty"` |
| 61 | 62 |
TrustKeyPath string `json:"-"` |
| 62 | 63 |
|
| ... | ... |
@@ -104,6 +105,7 @@ func (config *Config) InstallCommonFlags(cmd *flag.FlagSet, usageFn func(string) |
| 104 | 104 |
cmd.BoolVar(&config.AutoRestart, []string{"#r", "#-restart"}, true, usageFn("--restart on the daemon has been deprecated in favor of --restart policies on docker run"))
|
| 105 | 105 |
cmd.StringVar(&config.GraphDriver, []string{"s", "-storage-driver"}, "", usageFn("Storage driver to use"))
|
| 106 | 106 |
cmd.IntVar(&config.Mtu, []string{"#mtu", "-mtu"}, 0, usageFn("Set the containers network MTU"))
|
| 107 |
+ cmd.BoolVar(&config.RawLogs, []string{"-raw-logs"}, false, usageFn("Full timestamps without ANSI coloring"))
|
|
| 107 | 108 |
// FIXME: why the inconsistency between "hosts" and "sockets"? |
| 108 | 109 |
cmd.Var(opts.NewListOptsRef(&config.DNS, opts.ValidateIPAddress), []string{"#dns", "-dns"}, usageFn("DNS server to use"))
|
| 109 | 110 |
cmd.Var(opts.NewNamedListOptsRef("dns-opts", &config.DNSOptions, nil), []string{"-dns-opt"}, usageFn("DNS options to use"))
|
| ... | ... |
@@ -168,7 +168,10 @@ func (cli *DaemonCli) CmdDaemon(args ...string) error {
|
| 168 | 168 |
logrus.Warn("Running experimental build")
|
| 169 | 169 |
} |
| 170 | 170 |
|
| 171 |
- logrus.SetFormatter(&logrus.TextFormatter{TimestampFormat: jsonlog.RFC3339NanoFixed})
|
|
| 171 |
+ logrus.SetFormatter(&logrus.TextFormatter{
|
|
| 172 |
+ TimestampFormat: jsonlog.RFC3339NanoFixed, |
|
| 173 |
+ DisableColors: cli.Config.RawLogs, |
|
| 174 |
+ }) |
|
| 172 | 175 |
|
| 173 | 176 |
if err := setDefaultUmask(); err != nil {
|
| 174 | 177 |
logrus.Fatalf("Failed to set umask: %v", err)
|
| ... | ... |
@@ -54,6 +54,7 @@ weight = -1 |
| 54 | 54 |
--mtu=0 Set the containers network MTU |
| 55 | 55 |
--disable-legacy-registry Do not contact legacy registries |
| 56 | 56 |
-p, --pidfile="/var/run/docker.pid" Path to use for daemon PID file |
| 57 |
+ --raw-logs Full timestamps without ANSI coloring |
|
| 57 | 58 |
--registry-mirror=[] Preferred Docker registry mirror |
| 58 | 59 |
-s, --storage-driver="" Storage driver to use |
| 59 | 60 |
--selinux-enabled Enable selinux support |
| ... | ... |
@@ -860,19 +861,20 @@ This is a full example of the allowed configuration options in the file: |
| 860 | 860 |
"group": "", |
| 861 | 861 |
"cgroup-parent": "", |
| 862 | 862 |
"default-ulimits": {},
|
| 863 |
- "ipv6": false, |
|
| 864 |
- "iptables": false, |
|
| 865 |
- "ip-forward": false, |
|
| 866 |
- "ip-mask": false, |
|
| 867 |
- "userland-proxy": false, |
|
| 868 |
- "ip": "0.0.0.0", |
|
| 869 |
- "bridge": "", |
|
| 870 |
- "bip": "", |
|
| 871 |
- "fixed-cidr": "", |
|
| 872 |
- "fixed-cidr-v6": "", |
|
| 873 |
- "default-gateway": "", |
|
| 874 |
- "default-gateway-v6": "", |
|
| 875 |
- "icc": false |
|
| 863 |
+ "ipv6": false, |
|
| 864 |
+ "iptables": false, |
|
| 865 |
+ "ip-forward": false, |
|
| 866 |
+ "ip-mask": false, |
|
| 867 |
+ "userland-proxy": false, |
|
| 868 |
+ "ip": "0.0.0.0", |
|
| 869 |
+ "bridge": "", |
|
| 870 |
+ "bip": "", |
|
| 871 |
+ "fixed-cidr": "", |
|
| 872 |
+ "fixed-cidr-v6": "", |
|
| 873 |
+ "default-gateway": "", |
|
| 874 |
+ "default-gateway-v6": "", |
|
| 875 |
+ "icc": false, |
|
| 876 |
+ "raw-logs": false |
|
| 876 | 877 |
} |
| 877 | 878 |
``` |
| 878 | 879 |
|
| ... | ... |
@@ -44,6 +44,7 @@ docker-daemon - Enable daemon mode |
| 44 | 44 |
[**--log-opt**[=*map[]*]] |
| 45 | 45 |
[**--mtu**[=*0*]] |
| 46 | 46 |
[**-p**|**--pidfile**[=*/var/run/docker.pid*]] |
| 47 |
+[**--raw-logs**] |
|
| 47 | 48 |
[**--registry-mirror**[=*[]*]] |
| 48 | 49 |
[**-s**|**--storage-driver**[=*STORAGE-DRIVER*]] |
| 49 | 50 |
[**--selinux-enabled**] |
| ... | ... |
@@ -197,6 +198,11 @@ unix://[/path/to/socket] to use. |
| 197 | 197 |
**-p**, **--pidfile**="" |
| 198 | 198 |
Path to use for daemon PID file. Default is `/var/run/docker.pid` |
| 199 | 199 |
|
| 200 |
+**--raw-logs** |
|
| 201 |
+Output daemon logs in full timestamp format without ANSI coloring. If this flag is not set, |
|
| 202 |
+the daemon outputs condensed, colorized logs if a terminal is detected, or full ("raw")
|
|
| 203 |
+output otherwise. |
|
| 204 |
+ |
|
| 200 | 205 |
**--registry-mirror**=*<scheme>://<host>* |
| 201 | 206 |
Prepend a registry mirror to be used for image pulls. May be specified multiple times. |
| 202 | 207 |
|