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: logspout/README.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,34 +1,34 @@
1
1
# logspout
2
2
3
-
A log router for Docker container output that runs entirely inside Docker. It attaches to all containers on a host, then routes their logs wherever you want.
3
+
A log router for Docker container output that runs entirely inside Docker. It attaches to all containers on a host, then routes their logs wherever you want.
4
4
5
5
It's a 100% stateless log appliance (unless you persist routes). It's not meant for managing log files or looking at history. It is just a means to get your logs out to live somewhere else, where they belong.
6
6
7
-
For now it only captures stdout and stderr, but soon Docker will let us hook into more ... perhaps getting everything from every container's /dev/log.
7
+
For now it only captures stdout and stderr, but soon Docker will let us hook into more ... perhaps getting everything from every container's /dev/log.
8
8
9
9
## Getting logspout
10
10
11
-
Logspout is a very small Docker container (14MB virtual, based on busybox), so you can just pull it from the index:
11
+
Logspout is a very small Docker container, so you can just pull it from the index:
12
12
13
-
$ docker pull progrium/logspout
13
+
$ docker pull deis/logspout
14
14
15
15
## Using logspout
16
16
17
17
#### Route all container output to remote syslog
18
18
19
19
The simplest way to use logspout is to just take all logs and ship to a remote syslog. Just pass a default syslog target URI as the command. Also, we always mount the Docker Unix socket with `-v` to `/tmp/docker.sock`:
20
20
21
-
$ docker run -v=/var/run/docker.sock:/tmp/docker.sock progrium/logspout syslog://logs.papertrailapp.com:55555
21
+
$ docker run -v=/var/run/docker.sock:/tmp/docker.sock deis/logspout syslog://logs.papertrailapp.com:55555
22
22
23
-
Logs will be tagged with the container name. The hostname will be the hostname of the logspout container, so you probably want to set the container hostname to the actual hostname by adding `-h $HOSTNAME`.
23
+
If deis/logspout is deployed on Deis, it will connect automatically to deis-logger via service discovery.
24
24
25
25
#### Inspect log streams using curl
26
26
27
27
Whether or not you run it with a default routing target, if you publish its port 8000, you can connect with curl to see your local aggregated logs in realtime.
28
28
29
29
$ docker run -d -p 8000:8000 \
30
30
-v=/var/run/docker.sock:/tmp/docker.sock \
31
-
progrium/logspout
31
+
deis/logspout
32
32
$ curl $(docker port `docker ps -lq` 8000)/logs
33
33
34
34
You should see a nicely colored stream of all your container logs. You can filter by container name, log type, and more. You can also get JSON objects, or you can upgrade to WebSocket and get JSON logs in your browser.
@@ -37,14 +37,14 @@ See [Streaming Endpoints](#streaming-endpoints) for all options.
37
37
38
38
#### Create custom routes via HTTP
39
39
40
-
Along with streaming endpoints, logspout also exposes a `/routes` resource to create and manage routes.
40
+
Along with streaming endpoints, logspout also exposes a `/routes` resource to create and manage routes.
41
41
42
42
$ curl $(docker port `docker ps -lq` 8000)/logs -X POST \
That example creates a new syslog route to [Papertrail](https://papertrailapp.com) of only `stderr` for containers with `db` in their name.
45
+
That example creates a new syslog route to [Papertrail](https://papertrailapp.com) of only `stderr` for containers with `db` in their name.
46
46
47
-
By default, routes are ephemeral. But if you mount a volume to `/mnt/routes`, they will be persisted to disk.
47
+
By default, routes are ephemeral. But if you mount a volume to `/mnt/routes`, they will be persisted to disk.
48
48
49
49
See [Routes Resource](#routes-resource) for all options.
50
50
@@ -88,9 +88,9 @@ Takes a JSON object like this:
88
88
}
89
89
}
90
90
91
-
The `source` field should be an object with `filter`, `name`, or `id` fields. You can specify specific log types with the `types` field to collect only `stdout` or `stderr`. If you don't specify `types`, it will route all types.
91
+
The `source` field should be an object with `filter`, `name`, or `id` fields. You can specify specific log types with the `types` field to collect only `stdout` or `stderr`. If you don't specify `types`, it will route all types.
92
92
93
-
To route all logs of all types on all containers, don't specify a `source`.
93
+
To route all logs of all types on all containers, don't specify a `source`.
94
94
95
95
The `append_tag` field of `target` is optional and specific to `syslog`. It lets you append to the tag of syslog packets for this route. By default the tag is `<container-name>`, so an `append_tag` value of `.app` would make the tag `<container-name>.app`.
96
96
@@ -143,4 +143,4 @@ This project was made possible by [DigitalOcean](http://digitalocean.com).
0 commit comments