code: func NewRegistry(ctx context.Context, config *configuration.Configuration) (*Registry, error) {
  	var err error
  	ctx, err = configureLogging(ctx, config)
  	if err != nil {
  		return nil, fmt.Errorf("error configuring logger: %v", err)
  	}
  
  	configureBugsnag(config)
  
  	// inject a logger into the uuid library. warns us if there is a problem
  	// with uuid generation under low entropy.
  	uuid.Loggerf = dcontext.GetLogger(ctx).Warnf
  
  	app := handlers.NewApp(ctx, config)
  	// TODO(aaronl): The global scope of the health checks means NewRegistry
  	// can only be called once per process.
  	app.RegisterHealthChecks()
  	handler := configureReporting(app)
  	handler = alive("/", handler)
  	handler = health.Handler(handler)
  	handler = panicHandler(handler)
  	if !config.Log.AccessLog.Disabled {
  		handler = gorhandlers.CombinedLoggingHandler(os.Stdout, handler)
  	}
  
  	server := &http.Server{
  		Handler: handler,
  	}
  
  	return &Registry{
  		app:    app,
  		config: config,
  		server: server,
  	}, nil
  }
docs: // NewRegistry creates a new registry from a context and configuration struct.