Commit a14924a9 authored by David Hummel's avatar David Hummel Committed by Felix Delattre
Browse files

Logging Improvements

* Using [`GLib Logging Framework`](https://developer.gnome.org/programming-guidelines/stable/logging.html.en) for logging
  * Created new `g_logger` function for logging
    * Outputs to `stdout`/`stderr` only when running in `foreground`
      * `stderr` for `message`, `warning`, `critical` & `error` levels
      * `stdout` for `debug` & `info` levels
        * Use `G_MESSAGES_DEBUG=all` environment to enable `debug` to print
    * Otherwise, output will be to `syslog` or `systemd journal` (when appropriate)
* Standardized usage of `{LOG_PRIORITY}: ` prefix in log messages
  * Only when using `syslog`, otherwise `GLib Logging` will take care of it
* Changed `fprintf(stderr`, `printf` & `perror` calls to `g_logger` calls
  * You might want to check them out closely to make sure I chose the right levels
  * No changes to `logging/output` were made to "`foreground`" programs (I.E. `render_*`)
* Changed `0`,`1` to `no_argument`,`required_argument` in `getopt_long`'s `long_options`
  * Fixed `renderd`'s `foreground` opt (should be `no_argument` [0] rather than `reguired_argument` [1])
* Basic test for `mod_tile` module
* ~~Extended `renderd` log priority onto Mapnik's logger~~
parent 1ed85f3f
......@@ -25,7 +25,7 @@ jobs:
exit -1
fi
- name: install dependencies
run: sudo apt -y install apache2-dev libcairo2-dev libcurl4-gnutls-dev libiniparser-dev libmapnik-dev
run: sudo apt -y install apache2-dev libcairo2-dev libcurl4-gnutls-dev libglib2.0-dev libiniparser-dev libmapnik-dev
- name: autogen
run: ./autogen.sh
- name: configure
......
Makefile*
*.o
.deps/
.dirstamp
.libs/
*.la
*.lo
*.o
*.slo
.dirstamp
.deps/
.libs/
aclocal.m4
autom4te.cache/
compile
config.guess
config.guess~
config.h
config.h.in
config.h.in~
config.log
config.status
config.sub
config.sub~
configure
configure~
depcomp
gen_tile_test
install-sh
libtool
ltmain.sh
m4/libtool.m4
m4/lt~obsolete.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
Makefile*
missing
render_expired
render_list
render_old
render_speedtest
renderd
renderd.sock
renderd.stats
stamp-h1
aclocal.m4
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
stderr.out
......@@ -2,7 +2,7 @@ AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
AM_CPPFLAGS = $(PTHREAD_CFLAGS)
AM_CPPFLAGS = $(PTHREAD_CFLAGS) $(GLIB_CFLAGS)
STORE_SOURCES = \
src/store.c \
......@@ -12,8 +12,9 @@ STORE_SOURCES = \
src/store_rados.c \
src/store_ro_http_proxy.c \
src/store_ro_composite.c \
src/store_null.c
STORE_LDFLAGS = $(LIBMEMCACHED_LDFLAGS) $(LIBRADOS_LDFLAGS) $(LIBCURL)
src/store_null.c \
src/g_logger.c
STORE_LDFLAGS = $(LIBMEMCACHED_LDFLAGS) $(LIBRADOS_LDFLAGS) $(LIBCURL) $(GLIB_LIBS)
STORE_CPPFLAGS =
......@@ -53,14 +54,16 @@ render_speedtest_SOURCES = \
src/speedtest.cpp \
src/protocol_helper.c \
src/render_submit_queue.c \
src/sys_utils.c
render_speedtest_LDADD = $(PTHREAD_CFLAGS)
src/sys_utils.c \
src/g_logger.c
render_speedtest_LDADD = $(PTHREAD_CFLAGS) $(GLIB_LIBS)
render_list_SOURCES = \
src/render_list.c \
src/sys_utils.c \
src/protocol_helper.c \
src/render_submit_queue.c $(STORE_SOURCES)
src/render_submit_queue.c \
$(STORE_SOURCES)
render_list_LDADD = $(PTHREAD_CFLAGS) $(STORE_LDFLAGS)
render_expired_SOURCES = \
......@@ -76,8 +79,9 @@ render_old_SOURCES = \
src/render_old.c \
src/sys_utils.c \
src/protocol_helper.c \
src/render_submit_queue.c
render_old_LDADD = $(PTHREAD_CFLAGS)
src/render_submit_queue.c \
src/g_logger.c
render_old_LDADD = $(PTHREAD_CFLAGS) $(GLIB_LIBS)
#convert_meta_SOURCES = src/dir_utils.c src/store.c src/convert_meta.c
......@@ -93,7 +97,7 @@ gen_tile_test_SOURCES = \
src/cache_expire.c \
src/parameterize_style.cpp \
$(STORE_SOURCES)
gen_tile_test_CFLAGS = -DMAIN_ALREADY_DEFINED $(PTHREAD_CFLAGS)
gen_tile_test_CFLAGS = -DMAIN_ALREADY_DEFINED $(PTHREAD_CFLAGS) $(GLIB_CFLAGS)
gen_tile_test_CXXFLAGS = $(MAPNIK_CFLAGS)
gen_tile_test_LDADD = $(PTHREAD_CFLAGS) $(MAPNIK_LDFLAGS) $(STORE_LDFLAGS) -liniparser
......@@ -103,7 +107,7 @@ test: gen_tile_test
./gen_tile_test
all-local:
$(APXS) -c $(DEF_LDLIBS) $(AM_CFLAGS) \
$(APXS) -c $(DEF_LDLIBS) $(AM_CFLAGS) $(GLIB_CFLAGS) \
-I@srcdir@/includes $(AM_LDFLAGS) $(STORE_LDFLAGS) \
@srcdir@/src/mod_tile.c \
@srcdir@/src/sys_utils.c \
......@@ -114,12 +118,13 @@ all-local:
@srcdir@/src/store_rados.c \
@srcdir@/src/store_ro_http_proxy.c \
@srcdir@/src/store_ro_composite.c \
@srcdir@/src/store_null.c
@srcdir@/src/store_null.c \
@srcdir@/src/g_logger.c
install-mod_tile:
install-mod_tile:
mkdir -p $(DESTDIR)`$(APXS) -q LIBEXECDIR`
$(APXS) -S LIBEXECDIR=$(DESTDIR)`$(APXS) \
-q LIBEXECDIR` -c -i $(DEF_LDLIBS) $(AM_CFLAGS) \
-q LIBEXECDIR` -c -i $(DEF_LDLIBS) $(AM_CFLAGS) $(GLIB_CFLAGS) \
-I@srcdir@/includes $(AM_LDFLAGS) $(STORE_LDFLAGS) \
@srcdir@/src/mod_tile.c \
@srcdir@/src/sys_utils.c \
......@@ -130,4 +135,5 @@ install-mod_tile:
@srcdir@/src/store_rados.c \
@srcdir@/src/store_ro_http_proxy.c \
@srcdir@/src/store_ro_composite.c \
@srcdir@/src/store_null.c
@srcdir@/src/store_null.c \
@srcdir@/src/g_logger.c
......@@ -27,6 +27,7 @@ Requirements
* `Cairo 2D graphics library <https://cairographics.org/>`__
* `Curl library (SSL variant) <https://curl.haxx.se/>`__
* `Iniparser library <https://github.com/ndevilla/iniparser>`__
* `GLib library <https://gitlab.gnome.org/GNOME/glib>`__
Compilation
-----------
......@@ -42,6 +43,7 @@ slightly.
apache2-dev \
libcairo2-dev \
libcurl4-gnutls-dev \
libglib2.0-dev \
libiniparser-dev \
libmapnik-dev
......@@ -64,7 +66,7 @@ Packages
If you don't want to compile the software yourself. Precompiled
software packages for **Debian** and **Ubuntu** are being maintained by
the `Debian GIS Team <https://wiki.debian.org/DebianGis>`__ in the respective
the `Debian GIS Team <https://wiki.debian.org/DebianGis>`__ in the respective
`repository <https://salsa.debian.org/debian-gis-team/libapache2-mod-tile>`__.
Starting from the following operation systems and their versions:
......@@ -117,7 +119,7 @@ Restart apache2:
$ sudo a2enconf renderd
And run the rendering daemon
And run the rendering daemon
::
......@@ -151,7 +153,7 @@ probably see a 404 error. Wait for the disk activity to
cease and then reload the tile. With a bit of luck you
should see a tile of the world in your browser window.
If this fails to happen check the http error log. You can
If this fails to happen check the http error log. You can
increase the level of debugging using the LogLevel apache
directive. If no log messages are shown check that you
are accessing the correct virtual host - the new version
......
......@@ -15,14 +15,15 @@ AC_PROG_CXX
AC_PROG_CC
AC_PROG_CC_C99
dnl Find C++ compiler
AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
if test "$HAVE_CXX" = "no"
then
AC_MSG_ERROR([Could not find a c++ compiler]);
dnl Find C++ compiler
AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
if test "$HAVE_CXX" = "no"
then
AC_MSG_ERROR([Could not find a c++ compiler]);
fi
# Checks for libraries.
PKG_CHECK_MODULES([GLIB], [glib-2.0])
# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stdint.h stdlib.h string.h sys/socket.h sys/time.h syslog.h unistd.h utime.h paths.h sys/cdefs.h sys/loadavg.h])
......
/*
* Copyright (c) 2007 - 2020 by mod_tile contributors (see AUTHORS file)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; If not, see http://www.gnu.org/licenses/.
*/
#ifndef GLOGGER_H
#define GLOGGER_H
#include <glib.h>
#ifdef __cplusplus
extern "C" {
#endif
void g_logger(int log_level, const char *format, ...);
const char *g_logger_level_name(int log_level);
#ifdef __cplusplus
}
#endif
#endif
......@@ -26,11 +26,6 @@ extern "C" {
#include <sys/types.h>
#include "render_config.h"
#define STORE_LOGLVL_DEBUG 0
#define STORE_LOGLVL_INFO 1
#define STORE_LOGLVL_WARNING 2
#define STORE_LOGLVL_ERR 3
struct stat_info {
off_t size; /* total size, in bytes */
time_t atime; /* time of last access */
......@@ -51,8 +46,6 @@ struct storage_backend {
void * storage_ctx;
};
void log_message(int log_lvl, const char *format, ...);
struct storage_backend * init_storage_backend(const char * options);
#ifdef __cplusplus
......
......@@ -16,7 +16,6 @@
*/
#include <string.h>
#include <syslog.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netdb.h>
......@@ -24,6 +23,7 @@
#include <stdio.h>
#include "cache_expire.h"
#include "g_logger.h"
/**
* This function sends a HTCP cache clr request for a given
* URL.
......@@ -101,7 +101,7 @@ static void cache_expire_url(int sock, char * url)
*((uint16_t *)(&buf[idx])) = htons(0);
if (send(sock, (void *) buf, (12 + 22 + url_len), 0) < (12 + 22 + url_len)) {
syslog(LOG_ERR, "Failed to send HTCP purge for %s\n", url);
g_logger(G_LOG_LEVEL_ERROR, "Failed to send HTCP purge for %s", url);
};
free(buf);
......@@ -137,7 +137,7 @@ int init_cache_expire(char * htcphost)
s = getaddrinfo(htcphost, HTCP_EXPIRE_CACHE_PORT, &hints, &result);
if (s != 0) {
syslog(LOG_ERR, "Failed to lookup HTCP cache host: %s", gai_strerror(s));
g_logger(G_LOG_LEVEL_ERROR, "Failed to lookup HTCP cache host: %s", gai_strerror(s));
return -1;
}
......@@ -161,7 +161,7 @@ int init_cache_expire(char * htcphost)
}
if (rp == NULL) { /* No address succeeded */
syslog(LOG_ERR, "Failed to create HTCP cache socket");
g_logger(G_LOG_LEVEL_ERROR, "Failed to create HTCP cache socket");
return -1;
}
......@@ -170,4 +170,3 @@ int init_cache_expire(char * htcphost)
return sfd;
}
This diff is collapsed.
/*
* Copyright (c) 2007 - 2020 by mod_tile contributors (see AUTHORS file)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; If not, see http://www.gnu.org/licenses/.
*/
#define _GNU_SOURCE 1
#define G_LOG_USE_STRUCTURED 1
#include <glib.h>
#include <stdio.h>
#include <syslog.h>
extern int foreground;
const char *g_logger_level_name(int log_level)
{
switch (log_level) {
case G_LOG_LEVEL_ERROR:
return "ERROR";
case G_LOG_LEVEL_CRITICAL:
return "CRITICAL";
case G_LOG_LEVEL_WARNING:
return "WARNING";
case G_LOG_LEVEL_MESSAGE:
return "MESSAGE";
case G_LOG_LEVEL_INFO:
return "INFO";
case G_LOG_LEVEL_DEBUG:
return "DEBUG";
default:
return "UNKNOWN";
}
}
void g_logger(int log_level, const char *format, ...)
{
int size;
char *log_message, *log_message_prefixed;
va_list args;
va_start(args, format);
size = vasprintf(&log_message, format, args);
if (size == -1) {
g_error("ERROR: vasprintf failed in g_logger");
}
const GLogField log_fields[] = {{"MESSAGE", log_message, -1}};
size = asprintf(&log_message_prefixed, "%s: %s", g_logger_level_name(log_level), log_message);
if (size == -1) {
g_error("ERROR: asprintf failed in g_logger");
}
const GLogField log_fields_prefixed[] = {{"MESSAGE", log_message_prefixed, -1}};
if (foreground == 1) {
switch (log_level) {
// Levels >= G_LOG_LEVEL_ERROR will terminate the program
case G_LOG_LEVEL_ERROR:
g_log_writer_standard_streams(log_level, log_fields, 1, NULL);
break;
// Levels <= G_LOG_LEVEL_INFO will only show when using G_MESSAGES_DEBUG
case G_LOG_LEVEL_INFO:
g_log_writer_standard_streams(log_level, log_fields, 1, NULL);
break;
default:
g_log_writer_default(log_level, log_fields, 1, NULL);
}
} else if (g_log_writer_is_journald(fileno(stderr))) {
switch (log_level) {
// Levels >= G_LOG_LEVEL_ERROR will terminate the program
case G_LOG_LEVEL_ERROR:
g_log_writer_journald(log_level, log_fields, 1, NULL);
break;
// Levels <= G_LOG_LEVEL_INFO will only show when using G_MESSAGES_DEBUG
case G_LOG_LEVEL_INFO:
g_log_writer_journald(log_level, log_fields, 1, NULL);
break;
default:
g_log_writer_default(log_level, log_fields, 1, NULL);
}
} else {
setlogmask(LOG_UPTO(LOG_INFO));
switch (log_level) {
case G_LOG_LEVEL_ERROR:
syslog(LOG_ERR, log_message_prefixed, NULL);
break;
case G_LOG_LEVEL_CRITICAL:
syslog(LOG_CRIT, log_message_prefixed, NULL);
break;
case G_LOG_LEVEL_WARNING:
syslog(LOG_WARNING, log_message_prefixed, NULL);
break;
case G_LOG_LEVEL_MESSAGE:
syslog(LOG_INFO, log_message_prefixed, NULL);
break;
case G_LOG_LEVEL_INFO:
syslog(LOG_INFO, log_message_prefixed, NULL);
break;
case G_LOG_LEVEL_DEBUG:
syslog(LOG_DEBUG, log_message_prefixed, NULL);
break;
}
}
va_end(args);
free(log_message_prefixed);
free(log_message);
}
......@@ -32,7 +32,6 @@
#include <sys/types.h>
#include <sys/time.h>
#include <dirent.h>
#include <syslog.h>
#include <unistd.h>
#include <pthread.h>
#include <string>
......@@ -47,6 +46,7 @@
#include "request_queue.h"
#include "cache_expire.h"
#include "parameterize_style.hpp"
#include "g_logger.h"
#ifdef HTCP_EXPIRE_CACHE
#include <sys/socket.h>
......@@ -86,6 +86,8 @@ using namespace mapnik;
#define RENDER_SIZE (512)
#endif
extern int foreground;
struct projectionconfig {
double bound_x0;
double bound_y0;
......@@ -121,7 +123,7 @@ struct projectionconfig * get_projection(const char * srs)
struct projectionconfig * prj;
if (strstr(srs, "+proj=merc +a=6378137 +b=6378137") != NULL) {
syslog(LOG_DEBUG, "Using web mercator projection settings");
g_logger(G_LOG_LEVEL_DEBUG, "Using web mercator projection settings");
prj = (struct projectionconfig *)malloc(sizeof(struct projectionconfig));
prj->bound_x0 = -20037508.3428;
prj->bound_x1 = 20037508.3428;
......@@ -130,7 +132,7 @@ struct projectionconfig * get_projection(const char * srs)
prj->aspect_x = 1;
prj->aspect_y = 1;
} else if (strcmp(srs, "+proj=eqc +lat_ts=0 +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs") == 0) {
syslog(LOG_DEBUG, "Using plate carree projection settings");
g_logger(G_LOG_LEVEL_DEBUG, "Using plate carree projection settings");
prj = (struct projectionconfig *)malloc(sizeof(struct projectionconfig));
prj->bound_x0 = -20037508.3428;
prj->bound_x1 = 20037508.3428;
......@@ -139,7 +141,7 @@ struct projectionconfig * get_projection(const char * srs)
prj->aspect_x = 2;
prj->aspect_y = 1;
} else if (strcmp(srs, "+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +datum=OSGB36 +units=m +no_defs") == 0) {
syslog(LOG_DEBUG, "Using bng projection settings");
g_logger(G_LOG_LEVEL_DEBUG, "Using bng projection settings");
prj = (struct projectionconfig *)malloc(sizeof(struct projectionconfig));
prj->bound_x0 = 0;
prj->bound_y0 = 0;
......@@ -148,7 +150,7 @@ struct projectionconfig * get_projection(const char * srs)
prj->aspect_x = 1;
prj->aspect_y = 2;
} else {
syslog(LOG_WARNING, "Unknown projection string, using web mercator as never the less. %s", srs);
g_logger(G_LOG_LEVEL_WARNING, "Unknown projection string, using web mercator as never the less. %s", srs);
prj = (struct projectionconfig *)malloc(sizeof(struct projectionconfig));
prj->bound_x0 = -20037508.3428;
prj->bound_x1 = 20037508.3428;
......@@ -168,7 +170,7 @@ static void load_fonts(const char *font_dir, int recurse)
char path[PATH_MAX]; // FIXME: Eats lots of stack space when recursive
if (!fonts) {
syslog(LOG_CRIT, "Unable to open font directory: %s", font_dir);
g_logger(G_LOG_LEVEL_CRITICAL, "Unable to open font directory: %s", font_dir);
return;
}
......@@ -197,7 +199,7 @@ static void load_fonts(const char *font_dir, int recurse)
p = strrchr(path, '.');
if (p && (!strcmp(p, ".ttf") || !strcmp(p, ".otf") || !strcmp(p, ".ttc"))) {
syslog(LOG_DEBUG, "DEBUG: Loading font: %s", path);
g_logger(G_LOG_LEVEL_DEBUG, "Loading font: %s", path);
freetype_engine::register_font(path);
}
}
......@@ -252,7 +254,7 @@ static int check_xyz(int x, int y, int z, struct xmlmapconfig * map)
}
if (oob) {
syslog(LOG_INFO, "got bad co-ords: x(%d) y(%d) z(%d)\n", x, y, z);
g_logger(G_LOG_LEVEL_INFO, "got bad co-ords: x(%d) y(%d) z(%d)", x, y, z);
}
return !oob;
......@@ -270,7 +272,7 @@ mapnik::box2d<double> tile2prjbounds(struct projectionconfig * prj, int x, int y
double p1x = prj->bound_x0 + (prj->bound_x1 - prj->bound_x0) * (((double)x + render_size_tx) / (double)(prj->aspect_x * 1 << z));
double p1y = (prj->bound_y1 - (prj->bound_y1 - prj->bound_y0) * ((double)y / (double)(prj->aspect_y * 1 << z)));
syslog(LOG_DEBUG, "Rendering projected coordinates %i %i %i -> %f|%f %f|%f to a %i x %i tile\n", z, x, y, p0x, p0y, p1x, p1y, render_size_tx, render_size_ty);
g_logger(G_LOG_LEVEL_DEBUG, "Rendering projected coordinates %i %i %i -> %f|%f %f|%f to a %i x %i tile", z, x, y, p0x, p0y, p1x, p1y, render_size_tx, render_size_ty);
mapnik::box2d<double> bbox(p0x, p0y, p1x, p1y);
return bbox;
......@@ -302,8 +304,8 @@ static enum protoCmd render(struct xmlmapconfig * map, int x, int y, int z, char
mapnik::agg_renderer<mapnik::image_32> ren(map_parameterized, buf, map->scale);
ren.apply();
} catch (std::exception const& ex) {
syslog(LOG_ERR, "ERROR: failed to render TILE %s %d %d-%d %d-%d", map->xmlname, z, x, x + render_size_tx - 1, y, y + render_size_ty - 1);
syslog(LOG_ERR, " reason: %s", ex.what());
g_logger(G_LOG_LEVEL_ERROR, "failed to render TILE %s %d %d-%d %d-%d", map->xmlname, z, x, x + render_size_tx - 1, y, y + render_size_ty - 1);
g_logger(G_LOG_LEVEL_ERROR, " reason: %s", ex.what());
return cmdNotDone;
}
......@@ -358,7 +360,7 @@ static enum protoCmd render(Map &m, const char *tile_dir, char *xmlname, project
snprintf(tmp, sizeof(tmp), "%s.tmp", filename);
mapnik::image_view<mapnik::image_data_32> vw(128, 128, 256, 256, buf.data());
//std::cout << "Render " << z << " " << x << " " << y << " " << filename << "\n";
g_logger(G_LOG_LEVEL_DEBUG, "Render %i %i %i %s", z, x, y, filename)
mapnik::save_to_file(vw, tmp, "png256");
if (rename(tmp, filename)) {
......@@ -373,7 +375,8 @@ static enum protoCmd render(Map &m, const char *tile_dir, char *xmlname, project
void render_init(const char *plugins_dir, const char* font_dir, int font_dir_recurse)
{
syslog(LOG_INFO, "Renderd is using mapnik version %i.%i.%i", ((MAPNIK_VERSION) / 100000), (((MAPNIK_VERSION) / 100) % 1000), ((MAPNIK_VERSION) % 100));
g_logger(G_LOG_LEVEL_INFO, "Renderd is using mapnik version %i.%i.%i", ((MAPNIK_VERSION) / 100000), (((MAPNIK_VERSION) / 100) % 1000), ((MAPNIK_VERSION) % 100));
#if MAPNIK_VERSION >= 200200
mapnik::datasource_cache::instance().register_datasources(plugins_dir);
#else
......@@ -416,16 +419,16 @@ void *render_thread(void * arg)
* up the mapnik datasources to support larger postgres connection pools
*/
if (parentxmlconfig[iMaxConfigs].num_threads > 10) {
syslog(LOG_INFO, "Updating max_connection parameter for mapnik layers to reflect thread count");
g_logger(G_LOG_LEVEL_INFO, "Updating max_connection parameter for mapnik layers to reflect thread count");
parameterize_map_max_connections(maps[iMaxConfigs].map, parentxmlconfig[iMaxConfigs].num_threads);
}
maps[iMaxConfigs].prj = get_projection(maps[iMaxConfigs].map.srs().c_str());
} catch (std::exception const& ex) {
syslog(LOG_ERR, "An error occurred while loading the map layer '%s': %s", maps[iMaxConfigs].xmlname, ex.what());
g_logger(G_LOG_LEVEL_ERROR, "An error occurred while loading the map layer '%s': %s", maps[iMaxConfigs].xmlname, ex.what());
maps[iMaxConfigs].ok = 0;
} catch (...) {
syslog(LOG_ERR, "An unknown error occurred while loading the map layer '%s'", maps[iMaxConfigs].xmlname);
g_logger(G_LOG_LEVEL_ERROR, "An unknown error occurred while loading the map layer '%s'", maps[iMaxConfigs].xmlname);
maps[iMaxConfigs].ok = 0;
}
......@@ -439,9 +442,9 @@ void *render_thread(void * arg)
maps[iMaxConfigs].htcphost);
if (maps[iMaxConfigs].htcpsock > 0) {
syslog(LOG_INFO, "Successfully opened socket for HTCP cache expiry");
g_logger(G_LOG_LEVEL_INFO, "Successfully opened socket for HTCP cache expiry");
} else {
syslog(LOG_ERR, "Failed to opened socket for HTCP cache expiry");
g_logger(G_LOG_LEVEL_ERROR, "Failed to open socket for HTCP cache expiry");
}
} else {
maps[iMaxConfigs].htcpsock = -1;
......@@ -478,20 +481,20 @@ void *render_thread(void * arg)
struct stat_info sinfo = maps[i].store->tile_stat(maps[i].store, req->xmlname, req->options, item->mx, item->my, req->z);
if (sinfo.size > 0)
syslog(LOG_DEBUG, "DEBUG: START TILE %s %d %d-%d %d-%d, age %.2f days",
req->xmlname, req->z, item->mx, item->mx + size - 1, item->my, item->my + size - 1,
(tim.tv_sec - sinfo.mtime) / 86400.0);
g_logger(G_LOG_LEVEL_DEBUG, "START TILE %s %d %d-%d %d-%d, age %.2f days",
req->xmlname, req->z, item->mx, item->mx + size - 1, item->my, item->my + size - 1,
(tim.tv_sec - sinfo.mtime) / 86400.0);
else
syslog(LOG_DEBUG, "DEBUG: START TILE %s %d %d-%d %d-%d, new metatile",
req->xmlname, req->z, item->mx, item->mx + size - 1, item->my, item->my + size - 1);
g_logger(G_LOG_LEVEL_DEBUG, "START TILE %s %d %d-%d %d-%d, new metatile",
req->xmlname, req->z, item->mx, item->mx + size - 1, item->my, item->my + size - 1);