Skip to content

Commit 57c951d

Browse files
committed
README and config.json
1 parent 480eeb7 commit 57c951d

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ For example, to change the topic to "logs"
7777
| -------|------------| --------|
7878
|KAFKA_BROKER_ADDR|**(Required)** Comma delimited list of Kafka brokers. | |
7979
|LOG_TOPIC| Topic to which logs will be written to, can be set to `$CONTAINERNAME` to write to topics named after each container, or `$CONTAINERID` to write to topics named after each containers id. | dockerlogs |
80+
|LOG_TAG| Docker logs tag| common |
8081
|KEY_STRATEGY| Method in which Kafka methods should be keyed. Options are: <br>*key_by_timestamp* - Key each message by the timestamp of the log message <br>*key_by_container_id* - Key each message with the container id. | key_by_timestamp
8182
|PARTITION_STRATEGY| Kafka partitioner type. Options are:<br>*round_robin* - Write to each partition one after another, i.e equally distributed<br>*key_hash* - Partition based on the hash of the message key|round_robin|
8283
|LOG_LEVEL| Log level of the internal logger. Options: debug, info, warn, error|info|
@@ -112,6 +113,7 @@ Each log message will be written to a single Kafka message. The message within K
112113
"ContainerId": "be2af19df661fb08561a8a99c734f637f9dc1397c43d88379479fceb5fc0666d",
113114
"ContainerImageName": "hello-world",
114115
"ContainerImageId": "sha256:48b5124b2768d2b917edcb640435044a97967015485e812545546cbed5cf0233",
116+
"Tag": "common",
115117
"Err": null
116118
}
117119
```
@@ -128,6 +130,7 @@ Each log message will be written to a single Kafka message. The message within K
128130
| ContainerId | Id of the container that generated the log message |
129131
| ContainerImageName | Name of the container's image |
130132
| ContainerImageId | ID of the container's image |
133+
| Tag | The log tag |
131134
| Err | Usually null, otherwise will be a string containing and error from the logdriver |
132135

133136

config.json

+8
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@
3434
"value"
3535
]
3636
},
37+
{
38+
"name": "LOG_TAG",
39+
"description": "Tag for docker log",
40+
"value": "common",
41+
"settable": [
42+
"value"
43+
]
44+
},
3745
{
3846
"name": "KEY_STRATEGY",
3947
"description": "Method in which Kafka methods should be keyed",

main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func getKeyStrategyEnv() KeyStrategy {
8686
}
8787

8888
func getKeyTagEnv() string {
89-
tag := os.Getenv("TAG")
89+
tag := os.Getenv("LOG_TAG")
9090
if tag == "" {
9191
tag = "common"
9292
}

0 commit comments

Comments
 (0)