]> source.dussan.org Git - rspamd.git/commitdiff
* Improve logging
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Mon, 19 Jul 2010 08:10:38 +0000 (12:10 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Mon, 19 Jul 2010 08:10:38 +0000 (12:10 +0400)
* Write queue id to log
* Remove test messages from cmake

CMakeLists.txt
src/logger.c
src/message.c
src/protocol.c

index 9bf5a89b370bd87c4b65e009fed1db30e6404a08..48b4986184ab9b4998f4316cf4636dc54738806f 100644 (file)
@@ -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})
index 25839d02640012c6d56337aa47f7cd264502da9f..19ea767b8beaed8e308e4e9e8241dadb48a98b3d 100644 (file)
@@ -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;
index ef3cc02e69f99b5e4f1e2995177598faa4d03bdb..28369a33aa69674a7ec8f9714bce84e060bfae0d 100644 (file)
@@ -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) {
index 276b63a9eaa1560397e8e1543ae4e7b9755fb7bc..3dacfdc04bc8966b617dbfc4c8ee601f837470f6 100644 (file)
@@ -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;