mod_tile
mod_tile copied to clipboard
mod tile ignores apache Log settings.
The apache error log is spammed with many many entries of the type
debug: init_storage_backend: initialising file storage backend at: /var/lib/tirex/tiles
Now locking at the code I see that log_message() in store.c function gets a loglevel passed, but it is never actually compared against the LogLevel setting of Apache, so mod tile always runs in LogLevel debug.
Please honor the Apache LogLevel setting as it should be.
This is really annoying indeed - function called to log does not give a ... care for what is the user setting Please fix ? :)
src/store.c
void log_message(int log_lvl, const char *format, ...) {
va_list ap;
char *msg = malloc(1000*sizeof(char));
va_start(ap, format);
if (msg) {
vsnprintf(msg, 1000, format, ap);
switch (log_lvl) {
case STORE_LOGLVL_DEBUG:
fprintf(stderr, "debug: %s\n", msg);
break;
case STORE_LOGLVL_INFO:
fprintf(stderr, "info: %s\n", msg);
break;
case STORE_LOGLVL_WARNING:
fprintf(stderr, "WARNING: %s\n", msg);
break;
case STORE_LOGLVL_ERR:
fprintf(stderr, "ERROR: %s\n", msg);
break;
}
free(msg);
fflush(stderr);
}
va_end(ap);
}
How comes the log level is completely ignored? The readme promises that Apache LogLevel is considered.
This issue leads to a full hdd after several days of serving prerendered tiles without active renderer. /var/log/apache2/error.log
is full of messages like
[tile:notice] [pid 17569] [client 77.136.197.XXX] Failed to connect to renderer
even though Apache is set to LogLevel error
.