diff --git a/src/alert-debuglog.c b/src/alert-debuglog.c index f0d778fe60..019ea86814 100644 --- a/src/alert-debuglog.c +++ b/src/alert-debuglog.c @@ -463,7 +463,7 @@ OutputCtx *AlertDebugLogInitCtx(ConfNode *conf) output_ctx->data = file_ctx; output_ctx->DeInit = AlertDebugLogDeInitCtx; - SCLogInfo("Alert debug log output initialized"); + SCLogDebug("Alert debug log output initialized"); return output_ctx; error: diff --git a/src/alert-fastlog.c b/src/alert-fastlog.c index a4d4634b29..256c16bba7 100644 --- a/src/alert-fastlog.c +++ b/src/alert-fastlog.c @@ -328,7 +328,7 @@ void AlertFastLogExitPrintStats(ThreadVars *tv, void *data) { return; } - SCLogInfo("(%s) Alerts %" PRIu64 "", tv->name, aft->file_ctx->alerts); + SCLogInfo("Fast log output wrote %" PRIu64 " alerts", aft->file_ctx->alerts); } /** diff --git a/src/detect-pcre.c b/src/detect-pcre.c index 4be8c5001f..24bc1a8090 100644 --- a/src/detect-pcre.c +++ b/src/detect-pcre.c @@ -121,21 +121,31 @@ void DetectPcreRegister (void) { if (!ConfGetInt("pcre.match-limit", &val)) { pcre_match_limit = SC_MATCH_LIMIT_DEFAULT; + SCLogDebug("Using PCRE match-limit setting of: %i", pcre_match_limit); } else { pcre_match_limit = val; + if (pcre_match_limit != SC_MATCH_LIMIT_DEFAULT) { + SCLogInfo("Using PCRE match-limit setting of: %i", pcre_match_limit); + } else { + SCLogDebug("Using PCRE match-limit setting of: %i", pcre_match_limit); + } } - SCLogInfo("Using PCRE match-limit setting of: %i", pcre_match_limit); val = 0; if (!ConfGetInt("pcre.match-limit-recursion", &val)) { pcre_match_limit_recursion = SC_MATCH_LIMIT_RECURSION_DEFAULT; + SCLogDebug("Using PCRE match-limit-recursion setting of: %i", pcre_match_limit_recursion); } else { pcre_match_limit_recursion = val; + if (pcre_match_limit_recursion != SC_MATCH_LIMIT_RECURSION_DEFAULT) { + SCLogInfo("Using PCRE match-limit-recursion setting of: %i", pcre_match_limit_recursion); + } else { + SCLogDebug("Using PCRE match-limit-recursion setting of: %i", pcre_match_limit_recursion); + } } - SCLogInfo("Using PCRE match-limit-recursion setting of: %i", pcre_match_limit_recursion); parse_regex = pcre_compile(PARSE_REGEX, opts, &eb, &eo, NULL); if(parse_regex == NULL) diff --git a/src/detect.c b/src/detect.c index 6188a3c766..57415b676f 100644 --- a/src/detect.c +++ b/src/detect.c @@ -454,13 +454,13 @@ int DetectLoadSigFile(DetectEngineCtx *de_ctx, char *sig_file, int *sigs_tot) { int lineno = 0, multiline = 0; if (sig_file == NULL) { - SCLogError(SC_ERR_INVALID_ARGUMENT, "ERROR opening rule file null."); + SCLogError(SC_ERR_INVALID_ARGUMENT, "opening rule file null"); return -1; } FILE *fp = fopen(sig_file, "r"); if (fp == NULL) { - SCLogError(SC_ERR_OPENING_RULE_FILE, "ERROR opening rule file %s:" + SCLogError(SC_ERR_OPENING_RULE_FILE, "opening rule file %s:" " %s.", sig_file, strerror(errno)); return -1; } @@ -504,7 +504,7 @@ int DetectLoadSigFile(DetectEngineCtx *de_ctx, char *sig_file, int *sigs_tot) { SCLogDebug("signature %"PRIu32" loaded", sig->id); good++; } else { - SCLogError(SC_ERR_INVALID_SIGNATURE, "Error parsing signature \"%s\" from " + SCLogError(SC_ERR_INVALID_SIGNATURE, "error parsing signature \"%s\" from " "file %s at line %"PRId32"", line, sig_file, lineno - multiline); if (de_ctx->failure_fatal == 1) { exit(EXIT_FAILURE); @@ -3672,12 +3672,12 @@ int SigAddressPrepareStage3(DetectEngineCtx *de_ctx) { DetectPortSpHashFree(de_ctx); if (!(de_ctx->flags & DE_QUIET)) { - SCLogInfo("MPM memory %" PRIuMAX " (dynamic %" PRIu32 ", ctxs %" PRIuMAX ", avg per ctx %" PRIu32 ")", + SCLogDebug("MPM memory %" PRIuMAX " (dynamic %" PRIu32 ", ctxs %" PRIuMAX ", avg per ctx %" PRIu32 ")", de_ctx->mpm_memory_size + ((de_ctx->mpm_unique + de_ctx->mpm_uri_unique) * (uintmax_t)sizeof(MpmCtx)), de_ctx->mpm_memory_size, ((de_ctx->mpm_unique + de_ctx->mpm_uri_unique) * (uintmax_t)sizeof(MpmCtx)), de_ctx->mpm_unique ? de_ctx->mpm_memory_size / de_ctx->mpm_unique: 0); - SCLogInfo("max sig id %" PRIu32 ", array size %" PRIu32 "", DetectEngineGetMaxSigId(de_ctx), DetectEngineGetMaxSigId(de_ctx) / 8 + 1); + SCLogDebug("max sig id %" PRIu32 ", array size %" PRIu32 "", DetectEngineGetMaxSigId(de_ctx), DetectEngineGetMaxSigId(de_ctx) / 8 + 1); SCLogDebug("signature group heads: unique %" PRIu32 ", copies %" PRIu32 ".", de_ctx->gh_unique, de_ctx->gh_reuse); SCLogDebug("MPM instances: %" PRIu32 " unique, copies %" PRIu32 " (none %" PRIu32 ").", de_ctx->mpm_unique, de_ctx->mpm_reuse, de_ctx->mpm_none); diff --git a/src/flow.c b/src/flow.c index 9f09862003..9437dd39e5 100644 --- a/src/flow.c +++ b/src/flow.c @@ -814,8 +814,7 @@ void FlowHandlePacket (ThreadVars *tv, Packet *p) * \warning Not thread safe */ void FlowInitConfig(char quiet) { - if (quiet == FALSE) - SCLogInfo("initializing flow engine..."); + SCLogDebug("initializing flow engine..."); memset(&flow_config, 0, sizeof(flow_config)); SC_ATOMIC_INIT(flow_memuse); diff --git a/src/log-httplog.c b/src/log-httplog.c index e6c6b4a8e1..676a3e67e0 100644 --- a/src/log-httplog.c +++ b/src/log-httplog.c @@ -394,7 +394,7 @@ void LogHttpLogExitPrintStats(ThreadVars *tv, void *data) { return; } - SCLogInfo("(%s) HTTP requests %" PRIu32 "", tv->name, aft->uri_cnt); + SCLogInfo("HTTP logger logged %" PRIu32 " requests", aft->uri_cnt); } /** \brief Create a new http log LogFileCtx. @@ -436,7 +436,7 @@ OutputCtx *LogHttpLogInitCtx(ConfNode *conf) output_ctx->data = httplog_ctx; output_ctx->DeInit = LogHttpLogDeInitCtx; - SCLogInfo("HTTP log output initialized"); + SCLogDebug("HTTP log output initialized"); return output_ctx; } diff --git a/src/source-pcap-file.c b/src/source-pcap-file.c index fa03a4eb92..2b5eeef339 100644 --- a/src/source-pcap-file.c +++ b/src/source-pcap-file.c @@ -275,7 +275,7 @@ void ReceivePcapFileThreadExitStats(ThreadVars *tv, void *data) { SCEnter(); PcapFileThreadVars *ptv = (PcapFileThreadVars *)data; - SCLogInfo(" - (%s) Packets %" PRIu32 ", bytes %" PRIu64 ".", tv->name, ptv->pkts, ptv->bytes); + SCLogInfo("Pcap-file module read %" PRIu32 " packets, %" PRIu64 " bytes", ptv->pkts, ptv->bytes); return; } diff --git a/src/stream-tcp.c b/src/stream-tcp.c index 1bd4093cff..c3d8dfd435 100644 --- a/src/stream-tcp.c +++ b/src/stream-tcp.c @@ -3984,7 +3984,7 @@ void StreamTcpExitPrintStats(ThreadVars *tv, void *data) return; } - SCLogInfo("(%s) Packets %" PRIu64 "", tv->name, stt->pkts); + SCLogInfo("Stream TCP processed %" PRIu64 " TCP packets", stt->pkts); } /** diff --git a/src/suricata.c b/src/suricata.c index 8a98302efd..a2c2394513 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -481,6 +481,8 @@ void SCPrintBuildInfo(void) { #ifdef REVISION SCLogInfo("This is %s version %s (rev %s)", PROG_NAME, PROG_VER, xstr(REVISION)); +#elif defined RELEASE + SCLogInfo("This is %s version %s RELEASE", PROG_NAME, PROG_VER); #else SCLogInfo("This is %s version %s", PROG_NAME, PROG_VER); #endif @@ -1629,7 +1631,7 @@ int main(int argc, char **argv) int engine_retval = EXIT_SUCCESS; while(1) { if (suricata_ctl_flags != 0) { - SCLogInfo("signal received"); + SCLogDebug("signal received"); if (suricata_ctl_flags & SURICATA_STOP) { struct timeval ts_start; @@ -1638,7 +1640,7 @@ int main(int argc, char **argv) memset(&ts_start, 0x00, sizeof(ts_start)); gettimeofday(&ts_start, NULL); - SCLogInfo("EngineStop received"); + SCLogInfo("stopping engine, waiting for outstanding packets"); /* Stop the engine so it quits after processing the pcap file * but first make sure all packets are processed by all other diff --git a/src/util-coredump-config.c b/src/util-coredump-config.c index 6c4fc4be01..5e8d2fa0af 100644 --- a/src/util-coredump-config.c +++ b/src/util-coredump-config.c @@ -92,8 +92,9 @@ int32_t CoredumpLoadConfig (void) if (prctl (PR_SET_DUMPABLE, 1, 0, 0, 0) == -1) { SCLogInfo ("Unable to make this process dumpable."); return 0; + } else { + SCLogDebug ("Process is dumpable."); } - else SCLogInfo ("Process is dumpable."); } /* don't clear dumpable flag since this will have other effects; * just set dump size to 0 below */ diff --git a/src/util-debug.h b/src/util-debug.h index 29c2217520..8cf2a4ee9e 100644 --- a/src/util-debug.h +++ b/src/util-debug.h @@ -71,7 +71,11 @@ typedef enum { } SCLogOPIface; /* The default log_format, if it is not supplied by the user */ +#ifdef RELEASE +#define SC_LOG_DEF_LOG_FORMAT "%t - <%d> - " +#else #define SC_LOG_DEF_LOG_FORMAT "[%i] %t - (%f:%l) <%d> (%n) -- " +#endif /* The maximum length of the log message */ #define SC_LOG_MAX_LOG_MSG_LEN 2048 diff --git a/src/util-threshold-config.c b/src/util-threshold-config.c index abfe0c1efa..23a53080c7 100644 --- a/src/util-threshold-config.c +++ b/src/util-threshold-config.c @@ -188,7 +188,7 @@ int SCThresholdConfInitContext(DetectEngineCtx *de_ctx, FILE *utfd) SCThresholdConfParseFile(de_ctx, fd); SCThresholdConfDeInitContext(de_ctx, fd); - SCLogInfo("Global thresholding options defined"); + SCLogDebug("Global thresholding options defined"); return 0; error: