8000 Feature: log-driver json-file with log-opt tag and contextual parsing of labels/envs · Issue #19803 · moby/moby · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Feature: log-driver json-file with log-opt tag and contextual parsing of labels/envs #19803
Closed
@ajohnstone

Description

@ajohnstone

--log-opt tag="{{.ImageName}}/{{.Name}}/{{.ID}}" is not supported by log-driver json-file.
Ideally the behaviour should be consistent between all drivers. Additionally the "log-opt label" and "log-opt env" do not seem to parse the labels and/or env.

E.g.

$ sudo docker daemon -D  --log-driver=json-file --log-opt labels="com.photobox.full"

$ docker run --label="com.photobox.full={{.ImageName}}/{{.Name}}/{{.ID}}" -it ubuntu bash -c "echo ${RANDOM}"

$ cat /var/lib/docker/containers/7a821670f0c2147d2040888652f6155a09560d219de2520ce046bbd88a8c1e50/*.log
{"log":"\u001b]0;root@7a821670f0c2: /\u0007root@7a821670f0c2:/# echo $RANDOM\r\n","stream":"stdout","attrs":{"com.photobox.full":"{{.ImageName}}/{{.Name}}/{{.ID}}"},"time":"2016-01-28T11:39:43.824583496Z"}
{"log":"12186\r\n","stream":"stdout","attrs":{"com.photobox.full":"{{.ImageName}}/{{.Name}}/{{.ID}}"},"time":"2016-01-28T11:39:43.824700942Z"}

This would help with things like amazon ecs that controls the launching of docker containers.

docker version; docker info
Client:
 Version:      1.9.1
 API version:  1.21
 Go version:   go1.4.2
 Git commit:   a34a1d5
 Built:        Fri Nov 20 13:20:08 UTC 2015
 OS/Arch:      linux/amd64

Server:
 Version:      1.9.1
 API version:  1.21
 Go version:   go1.4.2
 Git commit:   a34a1d5
 Built:        Fri Nov 20 13:20:08 UTC 2015
 OS/Arch:      linux/amd64
Containers: 29
Images: 1473
Server Version: 1.9.1
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 1535
 Dirperm1 Supported: true
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 3.19.0-39-generic
Operating System: Ubuntu 15.10
CPUs: 8
Total Memory: 7.682 GiB
Name: andrew-office
ID: VRUJ:C7UG:LKAO:Q7AG:U3KK:SYDQ:GUUO:BC5C:2MWG:5LZS:H6ZK:FPXZ
Debug mode (server): true
 File Descriptors: 15
 Goroutines: 25
 System Time: 2016-01-28T12:41:11.380077965Z
 EventsListeners: 0
 Init SHA1: 6bd1e8a0cd16ab554af196c6ab421437489d902f
 Init Path: /usr/lib/docker/dockerinit
 Docker Root Dir: /var/lib/docker
WARNING: No swap limit support

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0