Logging not captured on behave steps
<p>Ok so in my environment.py file I am able to log stuff by:</p>

<pre><code>logging.basicConfig(level=logging.DEBUG, filename="example.log")

def before_feature(context, feature):
    logging.info("test logging")
</code></pre>

<p>but when I am inside the steps file I cannot perform logging:</p>

<pre><code>logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)

@given("we have a step")
def step_impl(context):
    logger.debug("Test logging 2")
</code></pre>

<p>The logging message inside the step does not show up. I am using the python behave module. Any ideas?</p>

<p>I have tried enabling and disabling logcapture when I run behave but it makes no difference.</p>