Commit ce66e4ecc697c7a87e8e73d19eebbdd385fdf073

Fix sample_config

  - Add missing values in sample_config.py
  - Moved to a RotatingFileHandler for logging
  
66from flask import Flask, request, jsonify, render_template, make_response, g
77import os
88import logging
9from logging.handlers import RotatingFileHandler
910
1011from classes.database import db
1112from config import DefaultConfig
155155 formatter = logging.Formatter('%(asctime)s %(levelname)s: %(message)s '
156156 '[in %(pathname)s:%(lineno)d]')
157157
158 # TODO: maybe we can use a RotatingFileHandler?
159158 # Also error can be sent out via email. So we can also have a SMTPHandler?
160 log_handler = logging.StreamHandler()
159 log_file = app.config['LOG_FILE']
160 max_size = 1024 * 1024 * 20 # Max Size for a log file: 20MB
161 log_handler = RotatingFileHandler(log_file, maxBytes=max_size,
162 backupCount=10)
161163
162164 if app.config.has_key('LOG_LEVEL'):
163165 log_level = app.config['LOG_LEVEL'] or 'ERROR'
  
1818 SQLALCHEMY_DATABASE_URI =\
1919 'dialect+driver://username:password@host:port/database'
2020
21 # Log level for the application
22 LOG_LEVEL = 'ERROR'
23
2124 # sqlalchemy debug messages; turn to False in prdocution
2225 SQLALCHEMY_ECHO = True #False
2326
2427 #DEFAULT_MAIL_SENDER = 'support@swtr.us'
2528
2629 # Configure your log paths
27 DEBUG_LOG = 'logs/debug.log'
28 ERROR_LOG = 'logs/error.log'
30 LOG_FILE = 'logs/swtstore.log'
2931
3032 # The Mozilla Persona Verifier Host. Leave it as it is.
3133 MOZ_PERSONA_VERIFIER = 'https://verifier.login.persona.org/verify'