fn: introducing docker-syslog driver as default logger (#1189)

* fn: introducing docker-syslog driver as default logger

With this change, fn-agent prefers RFC2454 docker-syslog driver
for logging stdout/stderr from containers. The advantage
of this is to offload it to docker itself instead of
streaming stderr along with stdout, which gets multiplexed
through single connection via docker-API.

The change will need support from FDKs in order to log
correct call-id and supress '\n' that splits syslog lines.
This commit is contained in:
Tolga Ceylan
2018-08-29 13:08:02 -07:00
committed by GitHub
parent 59f401d525
commit ad011fde7f
10 changed files with 134 additions and 295 deletions

View File

@@ -217,15 +217,11 @@ func (drv *DockerDriver) CreateCookie(ctx context.Context, task drivers.Containe
Image: task.Image(),
OpenStdin: true,
AttachStdout: true,
AttachStderr: true,
AttachStdin: true,
AttachStderr: true,
StdinOnce: true,
},
// turn off logs since we're collecting them from attach
HostConfig: &docker.HostConfig{
LogConfig: docker.LogConfig{
Type: "none",
},
ReadonlyRootfs: drv.conf.EnableReadOnlyRootFs,
},
Context: ctx,
@@ -237,6 +233,7 @@ func (drv *DockerDriver) CreateCookie(ctx context.Context, task drivers.Containe
drv: drv,
}
cookie.configureLogger(log)
cookie.configureMem(log)
cookie.configureCmd(log)
cookie.configureEnv(log)