I have created a simple HTTP server of files in the current directory using
python3 -m http.server 8000
This works very well for downloading files in this directory. Logging output is directed to the terminal window -- I assume to either stdout or stderr
I want to log activity through this server by writing log to a specified file.
I have tried
python3 -m http.server 8000 > log.txt 2>&1
But this produces an empty log.txt
.
What am I doing wrong? Is there a standard way of doing this or do I have to subclass the http.server
class? Something like that?