mod_tile icon indicating copy to clipboard operation
mod_tile copied to clipboard

mod tile ignores apache Log settings.

Open stoecker opened this issue 7 years ago • 2 comments

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.

stoecker avatar Apr 05 '17 08:04 stoecker

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);                                                                                                                                                                                                                               
}                         

nick4u avatar Aug 14 '18 06:08 nick4u

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.

der-stefan avatar Sep 14 '18 11:09 der-stefan