I think the problem is with your working directory; this line:
logging.basicConfig(filename='test.log', encoding='utf-8', level=logging.DEBUG)
...does not mean "log to the file 'test.log' in the same directory as the file that contains this line of code" -- it means "log to the file 'test.log' in this process's current working directory". Those can be the same, but often won't be. By default the working directory for your code will be your home directory, /home/pablopython
, and if you look there you'll probably see the log file that you're looking for.
If you want to log to a file in a particular directory, you can use a full filename like /home/pablopython/mysite/test.log
in your call to basicConfig
, or you can build a similar absolute path using Python's magic __file__
variable -- see this help page for more.