Don't write logs to the server's working directory when DEPLOYED.

Otherwise these logs will end up all getting split up when we switch
to the new deployment model.

(imported from commit 0514c296470be7113cab6c2f48e8dd33f1b9353d)
This commit is contained in:
Tim Abbott 2013-04-11 14:06:03 -04:00
parent a3ded3ecc1
commit f7406b9c7d
2 changed files with 7 additions and 6 deletions

View File

@ -333,8 +333,12 @@ CACHES['database'] = {
if DEPLOYED:
SERVER_LOG_PATH = "/home/humbug/logs/server.log"
EVENT_LOG_DIR = '/home/humbug/logs/event_log'
STATS_DIR = '/home/humbug/stats'
else:
EVENT_LOG_DIR = 'event_log'
SERVER_LOG_PATH = "server.log"
STATS_DIR = 'stats'
LOGGING = {
'version': 1,
@ -437,8 +441,6 @@ OPENID_RENDER_FAILURE = openid_failure_handler
MAILCHIMP_API_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-us4'
HUMBUG_FRIENDS_LIST_ID = '84b2f3da6b'
EVENT_LOG_DIR = 'event_log'
# Client-side polling timeout for get_events, in milliseconds.
# We configure this here so that the client test suite can override it.
# We already kill the connection server-side with heartbeat events,

View File

@ -1,15 +1,14 @@
from django.conf import settings
import os
import logging
STATS_DIR = os.path.join(os.path.dirname(__file__), "..", "..", "stats")
def update_stat(name, value):
try:
os.mkdir(STATS_DIR)
os.mkdir(settings.STATS_DIR)
except OSError:
pass
base_filename = os.path.join(STATS_DIR, name)
base_filename = os.path.join(settings.STATS_DIR, name)
tmp_filename = base_filename + ".new"
try: