Clean up default output. Use simpler output format for releases.

remotes/origin/master-1.2.x
Victor Julien 15 years ago
parent ff9fb7e1b5
commit 28e15be526

@ -463,7 +463,7 @@ OutputCtx *AlertDebugLogInitCtx(ConfNode *conf)
output_ctx->data = file_ctx; output_ctx->data = file_ctx;
output_ctx->DeInit = AlertDebugLogDeInitCtx; output_ctx->DeInit = AlertDebugLogDeInitCtx;
SCLogInfo("Alert debug log output initialized"); SCLogDebug("Alert debug log output initialized");
return output_ctx; return output_ctx;
error: error:

@ -328,7 +328,7 @@ void AlertFastLogExitPrintStats(ThreadVars *tv, void *data) {
return; return;
} }
SCLogInfo("(%s) Alerts %" PRIu64 "", tv->name, aft->file_ctx->alerts); SCLogInfo("Fast log output wrote %" PRIu64 " alerts", aft->file_ctx->alerts);
} }
/** /**

@ -121,21 +121,31 @@ void DetectPcreRegister (void) {
if (!ConfGetInt("pcre.match-limit", &val)) { if (!ConfGetInt("pcre.match-limit", &val)) {
pcre_match_limit = SC_MATCH_LIMIT_DEFAULT; pcre_match_limit = SC_MATCH_LIMIT_DEFAULT;
SCLogDebug("Using PCRE match-limit setting of: %i", pcre_match_limit);
} }
else { else {
pcre_match_limit = val; 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; val = 0;
if (!ConfGetInt("pcre.match-limit-recursion", &val)) { if (!ConfGetInt("pcre.match-limit-recursion", &val)) {
pcre_match_limit_recursion = SC_MATCH_LIMIT_RECURSION_DEFAULT; pcre_match_limit_recursion = SC_MATCH_LIMIT_RECURSION_DEFAULT;
SCLogDebug("Using PCRE match-limit-recursion setting of: %i", pcre_match_limit_recursion);
} }
else { else {
pcre_match_limit_recursion = val; 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); parse_regex = pcre_compile(PARSE_REGEX, opts, &eb, &eo, NULL);
if(parse_regex == NULL) if(parse_regex == NULL)

@ -454,13 +454,13 @@ int DetectLoadSigFile(DetectEngineCtx *de_ctx, char *sig_file, int *sigs_tot) {
int lineno = 0, multiline = 0; int lineno = 0, multiline = 0;
if (sig_file == NULL) { 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; return -1;
} }
FILE *fp = fopen(sig_file, "r"); FILE *fp = fopen(sig_file, "r");
if (fp == NULL) { 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)); " %s.", sig_file, strerror(errno));
return -1; return -1;
} }
@ -504,7 +504,7 @@ int DetectLoadSigFile(DetectEngineCtx *de_ctx, char *sig_file, int *sigs_tot) {
SCLogDebug("signature %"PRIu32" loaded", sig->id); SCLogDebug("signature %"PRIu32" loaded", sig->id);
good++; good++;
} else { } 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); "file %s at line %"PRId32"", line, sig_file, lineno - multiline);
if (de_ctx->failure_fatal == 1) { if (de_ctx->failure_fatal == 1) {
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
@ -3672,12 +3672,12 @@ int SigAddressPrepareStage3(DetectEngineCtx *de_ctx) {
DetectPortSpHashFree(de_ctx); DetectPortSpHashFree(de_ctx);
if (!(de_ctx->flags & DE_QUIET)) { 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_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); 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("signature group heads: unique %" PRIu32 ", copies %" PRIu32 ".", de_ctx->gh_unique, de_ctx->gh_reuse);
SCLogDebug("MPM instances: %" PRIu32 " unique, copies %" PRIu32 " (none %" PRIu32 ").", SCLogDebug("MPM instances: %" PRIu32 " unique, copies %" PRIu32 " (none %" PRIu32 ").",
de_ctx->mpm_unique, de_ctx->mpm_reuse, de_ctx->mpm_none); de_ctx->mpm_unique, de_ctx->mpm_reuse, de_ctx->mpm_none);

@ -814,8 +814,7 @@ void FlowHandlePacket (ThreadVars *tv, Packet *p)
* \warning Not thread safe */ * \warning Not thread safe */
void FlowInitConfig(char quiet) void FlowInitConfig(char quiet)
{ {
if (quiet == FALSE) SCLogDebug("initializing flow engine...");
SCLogInfo("initializing flow engine...");
memset(&flow_config, 0, sizeof(flow_config)); memset(&flow_config, 0, sizeof(flow_config));
SC_ATOMIC_INIT(flow_memuse); SC_ATOMIC_INIT(flow_memuse);

@ -394,7 +394,7 @@ void LogHttpLogExitPrintStats(ThreadVars *tv, void *data) {
return; 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. /** \brief Create a new http log LogFileCtx.
@ -436,7 +436,7 @@ OutputCtx *LogHttpLogInitCtx(ConfNode *conf)
output_ctx->data = httplog_ctx; output_ctx->data = httplog_ctx;
output_ctx->DeInit = LogHttpLogDeInitCtx; output_ctx->DeInit = LogHttpLogDeInitCtx;
SCLogInfo("HTTP log output initialized"); SCLogDebug("HTTP log output initialized");
return output_ctx; return output_ctx;
} }

@ -275,7 +275,7 @@ void ReceivePcapFileThreadExitStats(ThreadVars *tv, void *data) {
SCEnter(); SCEnter();
PcapFileThreadVars *ptv = (PcapFileThreadVars *)data; 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; return;
} }

@ -3984,7 +3984,7 @@ void StreamTcpExitPrintStats(ThreadVars *tv, void *data)
return; return;
} }
SCLogInfo("(%s) Packets %" PRIu64 "", tv->name, stt->pkts); SCLogInfo("Stream TCP processed %" PRIu64 " TCP packets", stt->pkts);
} }
/** /**

@ -481,6 +481,8 @@ void SCPrintBuildInfo(void) {
#ifdef REVISION #ifdef REVISION
SCLogInfo("This is %s version %s (rev %s)", PROG_NAME, PROG_VER, xstr(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 #else
SCLogInfo("This is %s version %s", PROG_NAME, PROG_VER); SCLogInfo("This is %s version %s", PROG_NAME, PROG_VER);
#endif #endif
@ -1629,7 +1631,7 @@ int main(int argc, char **argv)
int engine_retval = EXIT_SUCCESS; int engine_retval = EXIT_SUCCESS;
while(1) { while(1) {
if (suricata_ctl_flags != 0) { if (suricata_ctl_flags != 0) {
SCLogInfo("signal received"); SCLogDebug("signal received");
if (suricata_ctl_flags & SURICATA_STOP) { if (suricata_ctl_flags & SURICATA_STOP) {
struct timeval ts_start; struct timeval ts_start;
@ -1638,7 +1640,7 @@ int main(int argc, char **argv)
memset(&ts_start, 0x00, sizeof(ts_start)); memset(&ts_start, 0x00, sizeof(ts_start));
gettimeofday(&ts_start, NULL); 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 /* Stop the engine so it quits after processing the pcap file
* but first make sure all packets are processed by all other * but first make sure all packets are processed by all other

@ -92,8 +92,9 @@ int32_t CoredumpLoadConfig (void)
if (prctl (PR_SET_DUMPABLE, 1, 0, 0, 0) == -1) { if (prctl (PR_SET_DUMPABLE, 1, 0, 0, 0) == -1) {
SCLogInfo ("Unable to make this process dumpable."); SCLogInfo ("Unable to make this process dumpable.");
return 0; return 0;
} else {
SCLogDebug ("Process is dumpable.");
} }
else SCLogInfo ("Process is dumpable.");
} }
/* don't clear dumpable flag since this will have other effects; /* don't clear dumpable flag since this will have other effects;
* just set dump size to 0 below */ * just set dump size to 0 below */

@ -71,7 +71,11 @@ typedef enum {
} SCLogOPIface; } SCLogOPIface;
/* The default log_format, if it is not supplied by the user */ /* 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) -- " #define SC_LOG_DEF_LOG_FORMAT "[%i] %t - (%f:%l) <%d> (%n) -- "
#endif
/* The maximum length of the log message */ /* The maximum length of the log message */
#define SC_LOG_MAX_LOG_MSG_LEN 2048 #define SC_LOG_MAX_LOG_MSG_LEN 2048

@ -188,7 +188,7 @@ int SCThresholdConfInitContext(DetectEngineCtx *de_ctx, FILE *utfd)
SCThresholdConfParseFile(de_ctx, fd); SCThresholdConfParseFile(de_ctx, fd);
SCThresholdConfDeInitContext(de_ctx, fd); SCThresholdConfDeInitContext(de_ctx, fd);
SCLogInfo("Global thresholding options defined"); SCLogDebug("Global thresholding options defined");
return 0; return 0;
error: error:

Loading…
Cancel
Save