You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: engine/admin/logging/gcplogs.md
+18
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,10 @@ takes precedence over information discovered from the metadata server so a
34
34
Docker daemon running in a Google Cloud Project can be overridden to log to a
35
35
different Google Cloud Project using `--gcp-project`.
36
36
37
+
Docker fetches the values for zone, instance name and instance id from Google
38
+
Cloud metadata server. Those values can be provided via options if metadata
39
+
server is not available. They will not override the values from metadata server.
40
+
37
41
## gcplogs options
38
42
39
43
You can use the `--log-opt NAME=VALUE` flag to specify these additional Google
@@ -45,6 +49,9 @@ Cloud Logging driver options:
45
49
|`gcp-log-cmd`| optional | Whether to log the command that the container was started with. Defaults to false. |
46
50
|`labels`| optional | Comma-separated list of keys of labels, which should be included in message, if these labels are specified for container. |
47
51
|`env`| optional | Comma-separated list of keys of environment variables, which should be included in message, if these variables are specified for container. |
52
+
|`gcp-meta-zone`| optional | Zone name for the instance. |
53
+
|`gcp-meta-name`| optional | Instance name. |
54
+
|`gcp-meta-id`| optional | Instance ID. |
48
55
49
56
If there is collision between `label` and `env` keys, the value of the `env`
50
57
takes precedence. Both options add additional fields to the attributes of a
@@ -54,6 +61,8 @@ Below is an example of the logging options required to log to the default
54
61
logging destination which is discovered by querying the GCE metadata server.
55
62
56
63
docker run --log-driver=gcplogs \
64
+
--log-opt labels=location \
65
+
--log-opt env=TEST \
57
66
--log-opt gcp-log-cmd=true \
58
67
--env "TEST=false" \
59
68
--label location=west \
@@ -62,3 +71,12 @@ logging destination which is discovered by querying the GCE metadata server.
62
71
This configuration also directs the driver to include in the payload the label
63
72
`location`, the environment variable `ENV`, and the command used to start the
64
73
container.
74
+
75
+
An example of the logging options for running outside of GCE (the daemon must be
0 commit comments