Skip to content

Commit

Permalink
Adds env variable for tail and fixes #15
Browse files Browse the repository at this point in the history
  • Loading branch information
amir20 committed Feb 19, 2019
1 parent e06d6a1 commit 667c096
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docker/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/docker/docker/client"
"io"
"log"
"os"
"sort"
"strings"
)
Expand Down Expand Up @@ -74,7 +75,11 @@ func (d *dockerClient) ListContainers() ([]Container, error) {
}

func (d *dockerClient) ContainerLogs(ctx context.Context, id string) (<-chan string, <-chan error) {
options := types.ContainerLogsOptions{ShowStdout: true, ShowStderr: true, Follow: true, Tail: "300", Timestamps: true}
tail := "300"
if value, ok := os.LookupEnv("TAIL_SIZE"); ok {
tail = value
}
options := types.ContainerLogsOptions{ShowStdout: true, ShowStderr: true, Follow: true, Tail: tail, Timestamps: true}
reader, err := d.cli.ContainerLogs(ctx, id, options)
errChannel := make(chan error, 1)

Expand Down

0 comments on commit 667c096

Please sign in to comment.