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: README.md
+12-6Lines changed: 12 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,20 @@
1
1
# logspout
2
2
3
-
A log router for Docker container log streams that runs entirely inside Docker. It attaches to all containers on a host, then routes their logs wherever you want. Other than the routes you make, it's a stateless log appliance. It's not meant for managing log files or looking at history, just a means to get your logs out to live somewhere else, where they belong.
3
+
A log router for Docker container log streams that runs entirely inside Docker. It attaches to all containers on a host, then routes their logs wherever you want.
4
+
5
+
Other than the routes you make, it's a stateless log appliance. It's not meant for managing log files or looking at history, just a means to get your logs out to live somewhere else, where they belong.
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.
4
8
5
9
## Getting logspout
6
10
7
11
Logspout is a (very small) Docker container, so you can just pull it from the index:
8
12
9
13
$ docker pull progrium/logspout
10
14
11
-
###Using logspout
15
+
## Using logspout
12
16
13
-
#### Route all logs to remote syslog
17
+
#### Route all container output to remote syslog
14
18
15
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`:
16
20
@@ -27,9 +31,9 @@ Whether or not you run it with a default routing target, if you publish it's por
27
31
progrium/logspout
28
32
$ curl $(docker port `docker ps -lq` 8000)/logs
29
33
30
-
You should see a nicely colored stream of all your container logs. You can also filter by name, ID, log type, and more. Or you can get JSON objects, or you can upgrade to WebSocket and get JSON logs in your browser.
34
+
You should see a nicely colored stream of all your container logs. You can also 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.
31
35
32
-
See [Streaming Endpoints](#streaming-endpoints) for more details.
36
+
See [Streaming Endpoints](#streaming-endpoints) for all options.
33
37
34
38
#### Create custom routes via HTTP
35
39
@@ -42,6 +46,8 @@ That example creates a new syslog route to [Papertrail](https://papertrailapp.co
42
46
43
47
By default, routes are ephemeral. But if you mount a volume to `/mnt/routes`, they will be persisted to disk.
44
48
49
+
See [Routes Resource](#routes-resource) for all options.
50
+
45
51
## HTTP API
46
52
47
53
### Streaming Endpoints
@@ -60,7 +66,7 @@ If you include a request `Accept: application/json` header, the output will be J
60
66
Since `/logs` and `/logs/filter:<string>` endpoints can return logs from multiple source, they will by default return color-coded loglines prefixed with the name of the container. You can turn off the color escape codes with query param `colors=off` or the alternative is to stream the data in JSON format, which won't use colors or prefixes.
61
67
62
68
63
-
### Routing Resource
69
+
### Routes Resource
64
70
65
71
Routes let you configure logspout to hand-off logs to another system. Right now the only supported target type is via UDP `syslog`, but hey that's pretty much everything.
0 commit comments