summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-07-19 12:10:38 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-07-19 12:10:38 +0400
commit4b4c9c35fe2347779d9636b71b4e1fb4456802f3 (patch)
treeb5d237c16893f83874fff36bffe57099deb80375
parent1cad485b678054cbf41302204d981176266c71bc (diff)
downloadrspamd-4b4c9c35fe2347779d9636b71b4e1fb4456802f3.tar.gz
rspamd-4b4c9c35fe2347779d9636b71b4e1fb4456802f3.zip
* Improve logging
* Write queue id to log * Remove test messages from cmake
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/logger.c6
-rw-r--r--src/message.c2
-rw-r--r--src/protocol.c4
4 files changed, 6 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9bf5a89b3..48b498618 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -684,8 +684,6 @@ ENDIF(NOT IS_DIRECTORY ${DESTDIR}/${ETC_PREFIX}/rspamd/plugins/lua)
FILE(GLOB LUA_PLUGINS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/src/plugins/lua" "${CMAKE_CURRENT_SOURCE_DIR}/src/plugins/lua/*.lua" )
FOREACH(LUA_PLUGIN IN LISTS LUA_PLUGINS)
GET_FILENAME_COMPONENT(_rp ${LUA_PLUGIN} PATH)
- MESSAGE(STATUS ${LUA_PLUGIN})
- MESSAGE(STATUS ${_rp})
IF(NOT IS_DIRECTORY ${DESTDIR}/${ETC_PREFIX}/rspamd/plugins/lua/${_rp})
INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory ${DESTDIR}/${ETC_PREFIX}/rspamd/plugins/lua/${_rp})")
ENDIF(NOT IS_DIRECTORY ${DESTDIR}/${ETC_PREFIX}/rspamd/plugins/lua/${_rp})
diff --git a/src/logger.c b/src/logger.c
index 25839d026..19ea767b8 100644
--- a/src/logger.c
+++ b/src/logger.c
@@ -485,7 +485,7 @@ file_log_function (const gchar * log_domain, const gchar *function, GLogLevelFla
now = time (NULL);
tms = localtime (&now);
- strftime (timebuf, sizeof (timebuf), "%b %d %H:%M:%S", tms);
+ strftime (timebuf, sizeof (timebuf), "%F %H:%M:%S", tms);
switch (rspamd_log->process_type) {
case TYPE_MAIN:
cptype = "main";
@@ -510,10 +510,10 @@ file_log_function (const gchar * log_domain, const gchar *function, GLogLevelFla
break;
}
if (function == NULL) {
- r = rspamd_snprintf (tmpbuf, sizeof (tmpbuf), "#%P(%s): %s rspamd ", rspamd_log->pid, cptype, timebuf);
+ r = rspamd_snprintf (tmpbuf, sizeof (tmpbuf), "%s #%P(%s) ", timebuf, rspamd_log->pid, cptype);
}
else {
- r = rspamd_snprintf (tmpbuf, sizeof (tmpbuf), "#%P(%s): %s rspamd %s: ", rspamd_log->pid, cptype, timebuf, function);
+ r = rspamd_snprintf (tmpbuf, sizeof (tmpbuf), "%s #%P(%s) %s: ", timebuf, rspamd_log->pid, cptype, function);
}
iov[0].iov_base = tmpbuf;
iov[0].iov_len = r;
diff --git a/src/message.c b/src/message.c
index ef3cc02e6..28369a33a 100644
--- a/src/message.c
+++ b/src/message.c
@@ -767,7 +767,7 @@ process_message (struct worker_task *task)
debug_task ("found %d parts in message", task->parts_count);
if (task->queue_id == NULL) {
- task->queue_id = (char *)g_mime_message_get_message_id (task->message);
+ task->queue_id = "undef";
}
task->message_id = g_mime_message_get_message_id (task->message);
if (task->message_id == NULL) {
diff --git a/src/protocol.c b/src/protocol.c
index 276b63a9e..3dacfdc04 100644
--- a/src/protocol.c
+++ b/src/protocol.c
@@ -719,7 +719,7 @@ write_check_reply (struct worker_task *task)
cd.task = task;
cd.log_buf = logbuf;
- cd.log_offset = rspamd_snprintf (logbuf, sizeof (logbuf), "msg ok, id: <%s>, ", task->message_id);
+ cd.log_offset = rspamd_snprintf (logbuf, sizeof (logbuf), "id: <%s>, qid: <%s>, ", task->message_id, task->queue_id);
cd.log_size = sizeof (logbuf);
cd.alive = TRUE;
@@ -805,7 +805,7 @@ write_process_reply (struct worker_task *task)
cd.task = task;
cd.log_buf = logbuf;
- cd.log_offset = rspamd_snprintf (logbuf, sizeof (logbuf), "msg ok, id: <%s>, ", task->message_id);
+ cd.log_offset = rspamd_snprintf (logbuf, sizeof (logbuf), "id: <%s>, qid: <%s>, ", task->message_id, task->queue_id);
cd.log_size = sizeof (logbuf);
cd.alive = TRUE;