Replace print with logging
Decide on certain logging levels
Separate application and server access logs.