code: func NewForwardRecorder(cfg ForwardRecorderConfig) (*ForwardRecorder, error) {
  	if err := cfg.CheckAndSetDefaults(); err != nil {
  		return nil, trace.Wrap(err)
  	}
  
  	// Always write sessions to local disk first, then forward them to the Auth
  	// Server later.
  	auditLog, err := NewForwarder(ForwarderConfig{
  		SessionID:      cfg.SessionID,
  		ServerID:       teleport.ComponentUpload,
  		DataDir:        cfg.DataDir,
  		RecordSessions: cfg.RecordSessions,
  		Namespace:      cfg.Namespace,
  		ForwardTo:      cfg.ForwardTo,
  	})
  	if err != nil {
  		return nil, trace.Wrap(err)
  	}
  
  	sr := &ForwardRecorder{
  		ForwardRecorderConfig: cfg,
  		Entry: logrus.WithFields(logrus.Fields{
  			trace.Component: cfg.Component,
  		}),
  		AuditLog: auditLog,
  	}
  	return sr, nil
  }
docs: // NewForwardRecorder returns a new instance of session recorder