Send everything in production through the gunicorn logger (allows rotation using USR1). Add a gunicorn logger that emits the logstash format. Move the gunicorn config to the conf subdir. Update the postrotate script to hopefully work.

This commit is contained in:
yackob03 2014-02-04 15:08:49 -05:00
parent f2fef9fcde
commit a6f98570a1
7 changed files with 49 additions and 17 deletions

View file

@ -135,14 +135,10 @@ class BuildNodeConfig(object):
BUILD_NODE_PULL_TOKEN = 'F02O2E86CQLKZUQ0O81J8XDHQ6F0N1V36L9JTOEEK6GKKMT1GI8PTJQT4OU88Y6G'
def logs_init_builder(level=logging.DEBUG, logfile=None):
def logs_init_builder(level=logging.DEBUG):
@staticmethod
def init_logs():
if logfile:
handler = logging.FileHandler(logfile)
else:
handler = logging.StreamHandler()
handler = logging.StreamHandler()
root_logger = logging.getLogger('')
root_logger.setLevel(level)
formatter = logstash_formatter.LogstashFormatter()
@ -182,5 +178,5 @@ class ProductionConfig(FlaskProdConfig, MailConfig, S3Storage, RDSMySQL,
GitHubProdConfig, DigitalOceanConfig, BuildNodeConfig,
S3Userfiles):
LOGGING_CONFIG = logs_init_builder(logfile='/mnt/logs/application.log')
LOGGING_CONFIG = logs_init_builder()
SEND_FILE_MAX_AGE_DEFAULT = 0