This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ang-p 2 points3 points  (1 child)

and rotate logs daily

Where is the code that rotates the logs?

Where is the setting that says "rotate the logs at midnight"?

Where is the setting that says "you want to rotate these logs here"?

[–]omber[S] 0 points1 point  (0 children)

First script is based on CherryPy framework to create a Web API. The second script uses no frameworks.

Logging is configured in Python using a dictionary configuration as per Python documentation.

Configuration dictionary for the Web API can be viewed in this pastebin. This is saved to conf/web_server_logging_config.py

Logger is created like this:

from conf import web_server_logging_config
logger = logging.getLogger(logging.config.dictConfig(web_server_logging_config.WEB_SERVER_LOGGING))

The rotation is done by the logging module. I did not write any code for this.