[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Maposmatic-dev] [PATCH maposmatic 2/2] Better example maposmaticd.sh ex
From: |
David Decotigny |
Subject: |
[Maposmatic-dev] [PATCH maposmatic 2/2] Better example maposmaticd.sh example script |
Date: |
Tue, 12 Jan 2010 00:07:40 +0100 |
From: David Decotigny <address@hidden>
This script shows how to configure the server so that the log messages
go to the same logging output for both ocitysmap and maposmaticd.
---
scripts/maposmaticd | 3 +--
scripts/maposmaticd.sh-template | 16 ++++++++++++++++
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/scripts/maposmaticd b/scripts/maposmaticd
index 2a7c29b..a75ffa3 100755
--- a/scripts/maposmaticd
+++ b/scripts/maposmaticd
@@ -25,8 +25,8 @@
import time, os , sys, select, signal, traceback, logging
from datetime import datetime, timedelta
-from www.maposmatic.models import MapRenderingJob
from www.settings import RENDERING_RESULT_PATH, LOG, RENDERING_RESULT_FORMATS,
RENDERING_RESULT_MAX_SIZE_GB, OCITYSMAP_CFG_PATH
+from www.maposmatic.models import MapRenderingJob
from ocitysmap.coords import BoundingBox as OCMBoundingBox
from ocitysmap.street_index import OCitySMap
import Image
@@ -173,7 +173,6 @@ if not os.path.isdir(RENDERING_RESULT_PATH):
RENDERING_RESULT_PATH)
sys.exit(1)
-logging.basicConfig()
LOG.info("started")
# Reset the job that might have been left into the "rendering" state
diff --git a/scripts/maposmaticd.sh-template b/scripts/maposmaticd.sh-template
index 30a448c..7905f5b 100755
--- a/scripts/maposmaticd.sh-template
+++ b/scripts/maposmaticd.sh-template
@@ -30,7 +30,23 @@ export PYTHONPATH
DJANGO_SETTINGS_MODULE="www.settings"
export DJANGO_SETTINGS_MODULE
+# Set this to the empty string for stderr
MAPOSMATIC_LOG_FILE="/tmp/maposmaticd.log"
export MAPOSMATIC_LOG_FILE
+### Log level (the higher, the quieter)
+# Critical: 50
+# Error: 40
+# Warning: 30
+# Info: 20
+# Debug: 10
+# NotSet: 0 (discouraged)
+MAPOSMATIC_LOG_LEVEL=20
+export MAPOSMATIC_LOG_LEVEL
+
+# To make sure ocitysmap + maposmatic are configured the same way: that
+# waym the logs for ocitysmap will go to the maposmatic logger
+MAPOSMATIC_LOG_TARGET="ocitysmap"
+export MAPOSMATIC_LOG_TARGET
+
exec "$_here"/maposmaticd
--
1.6.4.4