Browse Source

Merge pull request #8 from manugarri/master

add missing config settings. Remove indentation issue in logger_setup
Max Halford 8 years ago
parent
commit
a170e7cec6
3 changed files with 7 additions and 1 deletions
  1. 2 0
      app/config_dev.py
  2. 2 0
      app/config_prod.py
  3. 3 1
      app/logger_setup.py

+ 2 - 0
app/config_dev.py

@@ -30,3 +30,5 @@ BCRYPT_LOG_ROUNDS = 12
 
 LOG_LEVEL = logging.DEBUG
 LOG_FILENAME = 'activity.log'
+LOG_MAXBYTES = 1024
+LOG_BACKUPS = 2

+ 2 - 0
app/config_prod.py

@@ -30,3 +30,5 @@ BCRYPT_LOG_ROUNDS = 12
 
 LOG_LEVEL = logging.INFO
 LOG_FILENAME = 'activity.log'
+LOG_MAXBYTES = 1024
+LOG_BACKUPS = 2

+ 3 - 1
app/logger_setup.py

@@ -38,6 +38,7 @@ app.logger.removeHandler(app.logger.handlers[0])
 
 TZ = pytz.timezone(app.config['TIMEZONE'])
 
+
 def add_fields(_, level, event_dict):
     ''' Add custom fields to each record. '''
     now = dt.datetime.now()
@@ -55,9 +56,10 @@ def add_fields(_, level, event_dict):
 
     return event_dict
 
+
 # Add a handler to write log messages to a file
 if app.config.get('LOG_FILENAME'):
-   file_handler = RotatingFileHandler(filename=app.config['LOG_FILENAME'],
+    file_handler = RotatingFileHandler(filename=app.config['LOG_FILENAME'],
                                        maxBytes=app.config['LOG_MAXBYTES'],
                                        backupCount=app.config['LOG_BACKUPS'],
                                        mode='a',