code: func initFileLog(cfg *zaplog.FileLogConfig, logger *log.Logger) error {
  	if st, err := os.Stat(cfg.Filename); err == nil {
  		if st.IsDir() {
  			return errors.New("can't use directory as log file name")
  		}
  	}
  	if cfg.MaxSize == 0 {
  		cfg.MaxSize = DefaultLogMaxSize
  	}
  
  	// use lumberjack to logrotate
  	output := &lumberjack.Logger{
  		Filename:   cfg.Filename,
  		MaxSize:    int(cfg.MaxSize),
  		MaxBackups: int(cfg.MaxBackups),
  		MaxAge:     int(cfg.MaxDays),
  		LocalTime:  true,
  	}
  
  	if logger == nil {
  		log.SetOutput(output)
  	} else {
  		logger.Out = output
  	}
  	return nil
  }
docs: // initFileLog initializes file based logging options.