code: func (s *HTTPServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
  	startTime := time.Now()
  
  	lw := &logResponseWriter{w.(StdResponseWriter), http.StatusOK, 0}
  	ctx, cancel := context.WithCancel(s.Env.ctx)
  	defer cancel()
  
  	reqid := r.Header.Get(requestIDHeader)
  	if len(reqid) == 0 {
  		reqid = s.generator.Generate()
  	}
  	ctx = WithRequestID(ctx, reqid)
  
  	s.handler.ServeHTTP(lw, r.WithContext(ctx))
  
  	fields := map[string]interface{}{
  		log.FnType:           "access",
  		log.FnResponseTime:   time.Since(startTime).Seconds(),
  		log.FnProtocol:       r.Proto,
  		log.FnHTTPStatusCode: lw.status,
  		log.FnHTTPMethod:     r.Method,
  		log.FnURL:            r.RequestURI,
  		log.FnHTTPHost:       r.Host,
  		log.FnRequestSize:    r.ContentLength,
  		log.FnResponseSize:   lw.size,
  	}
  	ip, _, err := net.SplitHostPort(r.RemoteAddr)
  	if err != nil {
  		fields[log.FnRemoteAddress] = ip
  	}
  	ua := r.Header.Get("User-Agent")
  	if len(ua) > 0 {
  		fields[log.FnHTTPUserAgent] = ua
  	}
  	if len(reqid) > 0 {
  		fields[log.FnRequestID] = reqid
  	}
  
  	lv := log.LvInfo
  	switch {
  	case 500 <= lw.status:
  		lv = log.LvError
  	case 400 <= lw.status:
  		lv = log.LvWarn
  	}
  	s.AccessLog.Log(lv, "well: access", fields)
  }
docs: // ServeHTTP implements http.Handler interface.