Skip to content

Commit

Permalink
fix(logs): cleaner LOG_PATH attribute in cito.settings.base
Browse files Browse the repository at this point in the history
  • Loading branch information
extremeunix committed Nov 7, 2014
1 parent e992276 commit c8ca052
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
9 changes: 6 additions & 3 deletions cito/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@

PROJECT_ROOT = Path(__file__).ancestor(2)

LOG_PATH = PROJECT_ROOT.ancestor(1)
if not os.path.isdir(LOG_PATH.child('logs')):
os.mkdir(LOG_PATH.child('logs'))
LOG_PATH = PROJECT_ROOT.ancestor(1).child('logs')

if not os.path.isdir(LOG_PATH):
os.mkdir(LOG_PATH)

DEBUG = False

TEMPLATE_DEBUG = False

ADMINS = (
Expand Down
6 changes: 3 additions & 3 deletions cito/settings/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,23 @@
'poller_log_handler': {
'level': 'DEBUG',
'class': 'logging.handlers.RotatingFileHandler',
'filename': LOG_PATH.child('logs') + "/poller.log",
'filename': LOG_PATH + "/poller.log",
'maxBytes': 100000000,
'backupCount': 2,
'formatter': 'standard',
},
'listener_log_handler': {
'level': 'DEBUG',
'class': 'logging.handlers.RotatingFileHandler',
'filename': LOG_PATH.child('logs') + "/listener.log",
'filename': LOG_PATH + "/listener.log",
'maxBytes': 100000000,
'backupCount': 2,
'formatter': 'standard',
},
'auth_log_handler': {
'level': 'DEBUG',
'class': 'logging.handlers.RotatingFileHandler',
'filename': LOG_PATH.child('logs') + "/auth.log",
'filename': LOG_PATH + "/auth.log",
'maxBytes': 100000000,
'backupCount': 2,
'formatter': 'standard',
Expand Down
6 changes: 3 additions & 3 deletions cito/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,23 @@
'poller_log_handler': {
'level': 'DEBUG',
'class': 'logging.handlers.RotatingFileHandler',
'filename': LOG_PATH.child('logs') + "/poller.log",
'filename': LOG_PATH + "/poller.log",
'maxBytes': 100000000,
'backupCount': 2,
'formatter': 'standard',
},
'listener_log_handler': {
'level': 'DEBUG',
'class': 'logging.handlers.RotatingFileHandler',
'filename': LOG_PATH.child('logs') + "/listener.log",
'filename': LOG_PATH + "/listener.log",
'maxBytes': 100000000,
'backupCount': 2,
'formatter': 'standard',
},
'auth_log_handler': {
'level': 'DEBUG',
'class': 'logging.handlers.RotatingFileHandler',
'filename': LOG_PATH.child('logs') + "/auth.log",
'filename': LOG_PATH + "/auth.log",
'maxBytes': 100000000,
'backupCount': 2,
'formatter': 'standard',
Expand Down

0 comments on commit c8ca052

Please sign in to comment.