diff --git a/libcontainer/logs/logs.go b/libcontainer/logs/logs.go index b114a5f50a5..27b96846632 100644 --- a/libcontainer/logs/logs.go +++ b/libcontainer/logs/logs.go @@ -24,6 +24,7 @@ type Config struct { LogFormat string LogFilePath string LogPipeFd int + LogCaller bool } func ForwardLogs(logPipe io.ReadCloser) chan error { @@ -77,6 +78,7 @@ func ConfigureLogging(config Config) error { } logrus.SetLevel(config.LogLevel) + logrus.SetReportCaller(config.LogCaller) // XXX: while 0 is a valid fd (usually stdin), here we assume // that we never deliberately set LogPipeFd to 0. diff --git a/main.go b/main.go index 2b54970930e..328ea30c77a 100644 --- a/main.go +++ b/main.go @@ -190,6 +190,7 @@ func createLogConfig(context *cli.Context) logs.Config { LogLevel: logrus.InfoLevel, LogFilePath: logFilePath, LogFormat: context.GlobalString("log-format"), + LogCaller: context.GlobalBool("debug"), } if context.GlobalBool("debug") { config.LogLevel = logrus.DebugLevel