Skip to content

[internal] Logging Design

tlanclos edited this page Oct 21, 2015 · 1 revision

Note: This page is intended for internal use by the API team to assist implementation and does not contain information about the usage of the API.

Logging Design (logger.py)

This module will contain global loggers which may be accessed by any other module at any time. We will have one logger object called logger which will be created with Python's logging module. It's important to note that this design is not for implementing a thread safe logger class, but for setting up and configuring one that's already provided by Python.

The server must be given privileges via apache to write in this directory. You use, also, may not be able to write to this directory unless you give it permission. This is alright as this will be configured via apache. For testing, you may want to set the file name to ticket-api.log. You also may want to lower the file size to a kilobyte or so to test the filesize rolling.

Logger Requirements Version: 1.0

name value
filename /var/log/ticket-api/ticket-api.log
format %(asctime)s [%(levelname)s] [%(module)s.%(funcName)s:%(lineno)d] - %(message)s
datefmt %Y-%m-%d %H:%M:%S
rotate handler RotatingFileHandler
max file size 25M
backup count 9

Clone this wiki locally