introduction to logging introduction many programming languages have common logging libraries including java and cand of course python also has logging module indeed the python logging module has been part of the built in modules since python this discusses why you should add logging to your programswhat you should (and should notlog and why just using the print(function is not sufficient why loglogging is typically key aspect of any production applicationthis is because it is important to provide appropriate information to allow future investigation following some event or issue in such applications these investigations includediagnosing failuresthat is why did an application fail/crash identifying unusual or unexpected behaviourwhich might not cause the application to fail but which may leave it in an unexpected state or where data may be corrupted etc identifying performance or capacity issuesin such situations the application is performing as expected by it is not meeting some non-functional requirements associated with the speed at which it is operating or its ability to scale as the amount of data or the number of users grows dealing with attempted malicious behaviour in which some outside agent is attempting to affect the behaviour of the system or to acquire information which they should not have access to etc this could happen for exampleif you are creating python web application and user tries to hack into your web server (cspringer nature switzerland ag huntadvanced guide to python programmingundergraduate topics in computer science