Skip to content

Commit

Permalink
Docker log tail: Re-order args to also support podman aliased as docker
Browse files Browse the repository at this point in the history
Whilst we currently explicitly call out to "docker" for this experimental
way of reading local logs during development, we technically also support
podman when its available with the "docker" alias. However, podman
requires arguments to be set before the container name. Fix support for
this type of setup. This keeps compatibility with docker, which accepts
arguments in either order.
  • Loading branch information
lfittl committed Oct 3, 2023
1 parent 54cbc68 commit 39ef193
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion input/system/selfhosted/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ func setupLogLocationTail(ctx context.Context, logLocation string, out chan<- Se
func setupDockerTail(ctx context.Context, containerName string, out chan<- SelfHostedLogStreamItem, prefixedLogger *util.Logger) error {
var err error

cmd := exec.Command("docker", "logs", containerName, "-f", "--tail", "0")
cmd := exec.Command("docker", "logs", "-f", "--tail", "0", containerName)
stderr, _ := cmd.StderrPipe()

scanner := bufio.NewScanner(stderr)
Expand Down

0 comments on commit 39ef193

Please sign in to comment.