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
You can tell logspout to only display log entries since container "start" or "restart" event by setting a `BACKLOG=false` environment variable (equivalent to `docker logs --tail=0`):
91
+
You can tell logspout to only display log entries since container "start" or "restart" event by setting a `BACKLOG=false` environment variable (equivalent to `docker logs --since=0s`):
92
92
93
93
$ docker run -d --name="logspout" \
94
94
-e 'BACKLOG=false' \
@@ -99,6 +99,10 @@ The default behaviour is to output all logs since creation of the container (equ
99
99
100
100
> NOTE: Use of this option **may** cause the first few lines of log output to be missed following a container being started, if the container starts outputting logs before logspout has a chance to see them. If consistent capture of *every* line of logs is critical to your application, you might want to test thorougly and/or avoid this option (at the expense of getting the entire backlog for every restarting container). This does not affect containers that are removed and recreated.
101
101
102
+
103
+
#### Environment variable, TAIL
104
+
Whilst BACKLOG=false restricts the tail by setting the Docker Logs.Options.Since to time.Now(), another mechanism to restrict the tail is to set TAIL=n. Use of this mechanism avoids parsing the earlier content of the logfile which may have a speed advantage if the tail content is of no interest or has become corrupted.
105
+
102
106
#### Inspect log streams using curl
103
107
104
108
Using the [httpstream module](http://github.com/gliderlabs/logspout/blob/master/httpstream), you can connect with curl to see your local aggregated logs in realtime. You can do this without setting up a route URI.
@@ -135,10 +139,12 @@ Logspout relies on the Docker API to retrieve container logs. A failure in the A
135
139
136
140
*`ALLOW_TTY` - include logs from containers started with `-t` or `--tty` (i.e. `Allocate a pseudo-TTY`)
137
141
*`BACKLOG` - suppress container tail backlog
142
+
*`TAIL` - specify the number of lines in the log tail to capture when logspout starts (default `all`)
138
143
*`DEBUG` - emit debug logs
139
144
*`EXCLUDE_LABEL` - exclude logs with a given label
140
145
*`INACTIVITY_TIMEOUT` - detect hang in Docker API (default 0)
141
146
*`PORT` or `HTTP_PORT` - configure which port to listen on (default 80)
147
+
*`RAW_FORMAT` - log format for the raw adapter (default `{{.Data}}\n`)
142
148
*`RETRY_COUNT` - how many times to retry a broken socket (default 10)
143
149
*`ROUTESPATH` - path to routes (default `/mnt/routes`)
144
150
*`SYSLOG_DATA` - datum for data field (default `{{.Data}}`)
0 commit comments