code: func (s *Logging) Apply(c Config) error {
  	err := s.SetFormat(c.Format)
  	if err != nil {
  		return err
  	}
  
  	if c.LogSpec == "" {
  		c.LogSpec = os.Getenv("FABRIC_LOGGING_SPEC")
  	}
  	if c.LogSpec == "" {
  		c.LogSpec = defaultLevel.String()
  	}
  
  	err = s.LoggerLevels.ActivateSpec(c.LogSpec)
  	if err != nil {
  		return err
  	}
  
  	if c.Writer == nil {
  		c.Writer = os.Stderr
  	}
  	s.SetWriter(c.Writer)
  
  	var formatter logging.Formatter
  	switch s.Encoding() {
  	case JSON, LOGFMT:
  		formatter = SetFormat(defaultFormat)
  	default:
  		formatter = SetFormat(c.Format)
  	}
  
  	InitBackend(formatter, c.Writer)
  
  	return nil
  }
docs: // Apply applies the provided configuration to the logging system.