summaryrefslogtreecommitdiff
path: root/libpod/container_log.go
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2021-09-01 11:36:26 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2021-09-27 12:07:01 +0200
commit3ce98a5ec28840f2d7836a002a156974f37f6c0e (patch)
treee684194119ec89281b72b73569052d423d96a6ad /libpod/container_log.go
parent869cb9a65413cc99bf8ed0e158c0e2f7b0df513a (diff)
downloadpodman-3ce98a5ec28840f2d7836a002a156974f37f6c0e.tar.gz
podman-3ce98a5ec28840f2d7836a002a156974f37f6c0e.tar.bz2
podman-3ce98a5ec28840f2d7836a002a156974f37f6c0e.zip
logging: new mode -l passthrough
it allows to pass the current std streams down to the container. conmon support: https://github.com/containers/conmon/pull/289 [NO TESTS NEEDED] it needs a new conmon. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'libpod/container_log.go')
-rw-r--r--libpod/container_log.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/libpod/container_log.go b/libpod/container_log.go
index a65b2a44f..18840bff2 100644
--- a/libpod/container_log.go
+++ b/libpod/container_log.go
@@ -18,7 +18,7 @@ import (
var logDrivers []string
func init() {
- logDrivers = append(logDrivers, define.KubernetesLogging, define.NoLogging)
+ logDrivers = append(logDrivers, define.KubernetesLogging, define.NoLogging, define.PassthroughLogging)
}
// Log is a runtime function that can read one or more container logs.
@@ -34,6 +34,8 @@ func (r *Runtime) Log(ctx context.Context, containers []*Container, options *log
// ReadLog reads a containers log based on the input options and returns log lines over a channel.
func (c *Container) ReadLog(ctx context.Context, options *logs.LogOptions, logChannel chan *logs.LogLine) error {
switch c.LogDriver() {
+ case define.PassthroughLogging:
+ return errors.Wrapf(define.ErrNoLogs, "this container is using the 'passthrough' log driver, cannot read logs")
case define.NoLogging:
return errors.Wrapf(define.ErrNoLogs, "this container is using the 'none' log driver, cannot read logs")
case define.JournaldLogging: