From 2018f169a8eccdd4f08bdd9cc27edc2e238d1eb6 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Sun, 25 Oct 2015 10:38:53 +0100 Subject: Fix default log file path for multiple instances --- example_project/settings.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'example_project/settings.py') diff --git a/example_project/settings.py b/example_project/settings.py index f4d7ca609..43917523b 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -128,7 +128,7 @@ INSTALLED_APPS = [ # 'debug_toolbar', ] -LOGFILE = '/var/log/django/ishtar.log' +LOGFILE = '' LOGGING = { 'version': 1, @@ -218,8 +218,13 @@ if 'archaeological_files' in EXTRA_APPS: INSTALLED_APPS += EXTRA_APPS +PROJECT_SLUG = locals().get('PROJECT_SLUG', 'default') + if LOGFILE: LOGGING['handlers']['logfile']['filename'] = LOGFILE +else: + LOGGING['handlers']['logfile']['filename'] = \ + '/var/log/django/ishtar-' + PROJECT_SLUG + '.log' INTERNAL_IPS = ('127.0.0.1',) -- cgit v1.2.3