I am running the following code in a custom Python application:
if __name__ == '__main__':
logging.basicConfig(filemode='example.log', level=logging.DEBUG)
logging.debug('This message should go to the log file')
but the output is being written to standard out. I ran the same code from a Jupyter notebook and it creates the example.log file and writes the log message to it.
I read that the order of imports may be important. Here is the order:
import logging
import argparse
import time
import os
import sys
import json