MCPcopy Create free account
hub / github.com/zalando/skipper / initLog

Function initLog

skipper.go:1319–1353  ·  view source on GitHub ↗
(o Options)

Source from the content-addressed store, hash-verified

1317}
1318
1319func initLog(o Options) (*logging.AccessLogger, error) {
1320 var (
1321 logOutput io.Writer
1322 accessLogOutput io.Writer
1323 err error
1324 )
1325
1326 if o.ApplicationLogOutput != "" {
1327 logOutput, err = getLogOutput(o.ApplicationLogOutput)
1328 if err != nil {
1329 return nil, err
1330 }
1331 }
1332
1333 if !o.AccessLogDisabled && o.AccessLogOutput != "" {
1334 accessLogOutput, err = getLogOutput(o.AccessLogOutput)
1335 if err != nil {
1336 return nil, err
1337 }
1338 }
1339
1340 lg := logging.NewAccessLogger(logging.Options{
1341 ApplicationLogPrefix: o.ApplicationLogPrefix,
1342 ApplicationLogOutput: logOutput,
1343 ApplicationLogJSONEnabled: o.ApplicationLogJSONEnabled,
1344 ApplicationLogJsonFormatter: o.ApplicationLogJsonFormatter,
1345 AccessLogOutput: accessLogOutput,
1346 AccessLogJSONEnabled: o.AccessLogJSONEnabled,
1347 AccessLogStripQuery: o.AccessLogStripQuery,
1348 AccessLogJsonFormatter: o.AccessLogJsonFormatter,
1349 AccessLogFormatter: o.AccessLogFormatter,
1350 })
1351
1352 return lg, nil
1353}
1354
1355// readCgroupMemoryLimit reads the container memory limit from the cgroup
1356// filesystem (v2 path first, v1 fallback).

Callers 1

runFunction · 0.85

Calls 2

NewAccessLoggerFunction · 0.92
getLogOutputFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…