title: Unable to use Python Logging in sub-modules in Flask
body: <p>My Flask project layout has two folders - fro and back. Fro is my Flask app and "back" is the service layer that contains files/modules that my Flask app invokes.</p>
  
  <p>My problem is that while the log statements in the functions written in Fro are being logged on the output console, the log statements in the functions written in the service layer do not show up in the log output. </p>
  
  <p>I have tried disabling the default flask.logger but that does not seem to help.</p>
  
  <pre><code>app.logger.disabled = True
  logger = logging.getLogger('werkzeug')
  logger.disabled = True
  </code></pre>
  
  <p>Here is how the code looks like in app.py -</p>
  
  <pre><code>import os
  from flask import Flask
  import click
  import logging
  log = logging.getLogger(__name__)
  
  def create_app(test_config=None):
      # create and configure the app
      app = Flask(__name__, instance_relative_config=True)
      app.logger.info("This gets printed")
      configure(app)
      app.logger.info("This also gets printed")
      # bunch of code
      # ...
      return app
  </code></pre>
  
  <p>Here is how a route method looks like - </p>
  
  <pre><code>import logging
  from back.services import request_service
  log = logging.getLogger(__name__)
  
  
  @bp.route('/install', methods=('GET', 'POST'))
  def install():
      log.info("This gets printed")
      is_valid_request = request_service.check_request_authenticity(request)
      return str(is_hmac_valid)
  </code></pre>
  
  <p>The check_request_authenticity function in the request_service looks like this - </p>
  
  <pre><code>import logging
  log = logging.getLogger(__name__)
  def check_request_authenticity():
          log.info("However this DOES NOT get printed")
  
  </code></pre>
  
  <p>I want to be able to log in the functions in my service layer using the native python logging without having to pass the flask app.logger to the function in my service layer. </p>
  
  <p>Any pointers please?</p>