title: How can I get current base URI in flask?
body: <p>In below code, i want to store URL in a variable to check error on which URL error occured.</p>
  <pre><code>@app.route('/flights', methods=['GET'])
  def get_flight():
      flight_data= mongo.db.flight_details
      info = []
      for index in flight_data.find():
          info.append({'flight_name': index['flight_name'], 'flight_no': index['flight_no'], 'total_seat': index['total_seat'] })
      if request.headers['Accept'] == 'application/xml':
          template = render_template('data.xml', info=info)
          xml_response = make_response(template)
          xml_response.headers['Accept'] = 'application/xml'
          logger.info('sucessful got data')
          return xml_response
      elif request.headers['Accept'] == 'application/json':
          logger.info('sucessful got data')
          return jsonify(info)
  </code></pre>
  <p>Output:</p>
  <pre><code>* Restarting with stat
   * Debugger is active!
   * Debugger PIN: 165-678-508
   * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
  127.0.0.1 - - [28/Mar/2017 10:44:53] &quot;GET /flights HTTP/1.1&quot; 200 -
  </code></pre>
  <p>I want this message</p>
  <pre><code>&quot;127.0.0.1 - - [28/Mar/2017 10:44:53] &quot;GET /flights HTTP/1.1&quot; 200 -&quot;
  </code></pre>
  <p>should be stored in a variable or how can I get current URL that is executing?</p>