mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-12 05:44:06 +00:00
allow relative paths for log files
This commit is contained in:
@@ -634,7 +634,11 @@ Can be used as the same time as NOMINATIM_LOG_FILE.
|
|||||||
| **After Changes:** | run `nominatim refresh --website` |
|
| **After Changes:** | run `nominatim refresh --website` |
|
||||||
|
|
||||||
Enable logging of requests into a file with this setting by setting the log
|
Enable logging of requests into a file with this setting by setting the log
|
||||||
file where to log to. The entries in the log file have the following format:
|
file where to log to. A relative file name is assumed to be relative to
|
||||||
|
the project directory.
|
||||||
|
|
||||||
|
|
||||||
|
The entries in the log file have the following format:
|
||||||
|
|
||||||
<request time> <execution time in s> <number of results> <type> "<query string>"
|
<request time> <execution time in s> <number of results> <type> "<query string>"
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ Functions for bringing auxiliary data in the database up-to-date.
|
|||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
from textwrap import dedent
|
from textwrap import dedent
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
from psycopg2 import sql as pysql
|
from psycopg2 import sql as pysql
|
||||||
|
|
||||||
@@ -94,7 +95,7 @@ PHP_CONST_DEFS = (
|
|||||||
('Database_DSN', 'DATABASE_DSN', str),
|
('Database_DSN', 'DATABASE_DSN', str),
|
||||||
('Default_Language', 'DEFAULT_LANGUAGE', str),
|
('Default_Language', 'DEFAULT_LANGUAGE', str),
|
||||||
('Log_DB', 'LOG_DB', bool),
|
('Log_DB', 'LOG_DB', bool),
|
||||||
('Log_File', 'LOG_FILE', str),
|
('Log_File', 'LOG_FILE', Path),
|
||||||
('NoAccessControl', 'CORS_NOACCESSCONTROL', bool),
|
('NoAccessControl', 'CORS_NOACCESSCONTROL', bool),
|
||||||
('Places_Max_ID_count', 'LOOKUP_MAX_COUNT', int),
|
('Places_Max_ID_count', 'LOOKUP_MAX_COUNT', int),
|
||||||
('PolygonOutput_MaximumTypes', 'POLYGON_OUTPUT_MAX_TYPES', int),
|
('PolygonOutput_MaximumTypes', 'POLYGON_OUTPUT_MAX_TYPES', int),
|
||||||
@@ -162,7 +163,12 @@ def _quote_php_variable(var_type, config, conf_name):
|
|||||||
if not getattr(config, conf_name):
|
if not getattr(config, conf_name):
|
||||||
return 'false'
|
return 'false'
|
||||||
|
|
||||||
quoted = getattr(config, conf_name).replace("'", "\\'")
|
if var_type == Path:
|
||||||
|
value = str(config.get_path(conf_name))
|
||||||
|
else:
|
||||||
|
value = getattr(config, conf_name)
|
||||||
|
|
||||||
|
quoted = value.replace("'", "\\'")
|
||||||
return f"'{quoted}'"
|
return f"'{quoted}'"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user