title: Uber Zap logger not printing caller information in the log statement
body: <p>I am trying to put the same message to console and the log files at the same time with custom encoder for config. In the process I want to display the caller information but the same is not being displayed even if I have used <code>caller</code> key as suggested in the documentation.</p>
  <p>Below is the sample code for the same</p>
  <pre><code>package main
  
  import (
      &quot;os&quot;
      &quot;time&quot;
  
      &quot;go.uber.org/zap&quot;
      &quot;go.uber.org/zap/zapcore&quot;
      &quot;gopkg.in/natefinch/lumberjack.v2&quot;
  )
  
  var logLevelSeverity = map[zapcore.Level]string{
      zapcore.DebugLevel:  &quot;DEBUG&quot;,
      zapcore.InfoLevel:   &quot;INFO&quot;,
      zapcore.WarnLevel:   &quot;WARNING&quot;,
      zapcore.ErrorLevel:  &quot;ERROR&quot;,
      zapcore.DPanicLevel: &quot;CRITICAL&quot;,
      zapcore.PanicLevel:  &quot;ALERT&quot;,
      zapcore.FatalLevel:  &quot;EMERGENCY&quot;,
  }
  
  func SyslogTimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder) {
      enc.AppendString(t.Format(&quot;Jan 01, 2006  15:04:05&quot;))
  }
  
  func CustomEncodeLevel(level zapcore.Level, enc zapcore.PrimitiveArrayEncoder) {
      enc.AppendString(logLevelSeverity[level])
  }
  
  func CustomLevelFileEncoder(level zapcore.Level, enc zapcore.PrimitiveArrayEncoder) {
      enc.AppendString(&quot;[&quot; + logLevelSeverity[level] + &quot;]&quot;)
  }
  
  func main() {
  
      w := zapcore.AddSync(&amp;lumberjack.Logger{
          Filename:   &quot;temp1.log&quot;,
          MaxSize:    1024,
          MaxBackups: 20,
          MaxAge:     28,
          Compress:   true,
      })
  
      //Define config for the console output
      cfgConsole := zapcore.EncoderConfig{
          MessageKey:   &quot;message&quot;,
          LevelKey:     &quot;severity&quot;,
          EncodeLevel:  CustomEncodeLevel,
          TimeKey:      &quot;time&quot;,
          EncodeTime:   SyslogTimeEncoder,
          CallerKey:    &quot;caller&quot;,
          EncodeCaller: zapcore.FullCallerEncoder,
      }
      cfgFile := zapcore.EncoderConfig{
          MessageKey:   &quot;message&quot;,
          LevelKey:     &quot;severity&quot;,
          EncodeLevel:  CustomLevelFileEncoder,
          TimeKey:      &quot;time&quot;,
          EncodeTime:   SyslogTimeEncoder,
          CallerKey:    &quot;caller&quot;,
          EncodeCaller: zapcore.FullCallerEncoder,
      }
  
      consoleDebugging := zapcore.Lock(os.Stdout)
      //consoleError := zapcore.Lock(os.Stderr)
      core := zapcore.NewTee(
          zapcore.NewCore(zapcore.NewConsoleEncoder(cfgFile), w, zap.DebugLevel),
          zapcore.NewCore(zapcore.NewJSONEncoder(cfgConsole), consoleDebugging, zap.DebugLevel),
          //zapcore.NewCore(zapcore.NewJSONEncoder(zap.NewProductionEncoderConfig()), consoleError, zap.ErrorLevel),
      )
      //core := zapcore.NewCore(zapcore.NewConsoleEncoder(encConsole), w, zap.DebugLevel)
      wlogger := zap.New(core)
      wlogger.Debug(&quot;Sample debug for log file and console&quot;)
      wlogger.Warn(&quot;An warning message example&quot;)
      wlogger.Info(&quot;An info level message&quot;)
      coreFile := zapcore.NewCore(zapcore.NewConsoleEncoder(cfgFile), w, zap.DebugLevel)
      flogger := zap.New(coreFile)
      flogger.Debug(&quot;An exclusive message for file&quot;)
      //output
      //{&quot;severity&quot;:&quot;DEBUG&quot;,&quot;time&quot;:&quot;Nov 11, 2018  20:24:11&quot;,&quot;message&quot;:&quot;Sample debug for log file and console&quot;}
      //{&quot;severity&quot;:&quot;WARNING&quot;,&quot;time&quot;:&quot;Nov 11, 2018  20:24:11&quot;,&quot;message&quot;:&quot;An warning message example&quot;}
      //{&quot;severity&quot;:&quot;INFO&quot;,&quot;time&quot;:&quot;Nov 11, 2018  20:24:11&quot;,&quot;message&quot;:&quot;An info level message&quot;}
  }
  </code></pre>
  <p>Any thoughts why the caller information is not being displayed?</p>