Commit Graph

55 Commits (5e05fedc90d8547f193e9ac2b45b8ccb227078b1)

Author SHA1 Message Date
Philippe Antoine 2a1690e110 pcre2: move header include to suricata-common only 5 years ago
Philippe Antoine 3633c48e6e pcre2: migrate utility uses of pcre 5 years ago
Juliana Fajardini 09ea412614 util-debug: fix unchecked ConfGetBool call 5 years ago
Jason Ish 87a91e6aa8 logging: expose the log level with a function
The log level needs to exposed so Rust plugins can bootstrap
themselves with the correct login to SCLogNotice!(), etc work
as expected.
6 years ago
Victor Julien 8f2df0f938 logging: fix default log format for release mode 6 years ago
Victor Julien 415c992909 util/mem: cleanup by moving atomic from mem hdr 6 years ago
Victor Julien 481a1923b4 logging: turn SCLog and SCLogErr into funcs
Reduces compiled code size.
6 years ago
Victor Julien a8c8e2d5c9 common: use suricata-common.h in more places 6 years ago
Victor Julien 44d3f264bf app-layer: update API to return more details
Add AppLayerResult struct as the Parser return type in
preparation of allowing returning 'Incomplete(size)' similar
to what nom in Rust allows.
6 years ago
Jason Ish 62e4211f04 debug: add SCReturnBool function exit macro 7 years ago
Victor Julien d00950be81 log/file: use default-log-dir for suricata.log
Default to just suricata.log instead of the full path, so that
in user mode we can log in the user mode location.
7 years ago
Alexander Gozman 5c1a2b53f9 Bug #2466: map SC_LOG_CONFIG level to syslogs LOG_DEBUG 8 years ago
Victor Julien 2a4b5adce8 scan-build: simplify FatalErrorOnInit macro 9 years ago
Victor Julien 96b2e8afc0 gcc7: fixes for format string warnings
GCC 7.1.1 on Fedora gave several warnings with -Wimplicit-fallthrough
and -Wformat-truncation

This patch addresses the warnings.
9 years ago
Jason Ish fa742d1d14 log: wrap rotation and write in lock
The application log is subject to rotation, so the check for
rotation, the actual rotation and write needs to be done under
lock to ensure the file pointer is in a consisten state
at the time of write().

Fixes issue:
https://redmine.openinfosecfoundation.org/issues/2155
9 years ago
Victor Julien ab1200fbd7 compiler: more strict compiler warnings
Set flags by default:

    -Wmissing-prototypes
    -Wmissing-declarations
    -Wstrict-prototypes
    -Wwrite-strings
    -Wcast-align
    -Wbad-function-cast
    -Wformat-security
    -Wno-format-nonliteral
    -Wmissing-format-attribute
    -funsigned-char

Fix minor compiler warnings for these new flags on gcc and clang.
9 years ago
Jason Ish fffdc6e3fd logging: hook the application log file into rotation 10 years ago
Victor Julien b3bf7a5729 output: introduce config and perf output levels
Goal is to reduce info output
10 years ago
Victor Julien 554080cced lua: print lua script func/line/file in SCLog* funcs
Instead of printing the func/line/file of the C code SCLog* wrappers,
print them from inside the lua script. They are not always available.
10 years ago
Victor Julien 8394b38941 cppcheck: work around snprintf warning
Cppcheck 1.72 gives a warning on the following code pattern:

    char blah[32] = "";
    snprintf(blah, sizeof(blah), "something");

The warning is:

    (error) Buffer is accessed out of bounds.

While this appears to be a FP, in most cases the initialization to ""
was unnecessary as the snprintf statement immediately follows the
variable declaration.
11 years ago
Victor Julien 334e8656bf introduce fatal error macro's
Add 'FatalError' and 'FatalErrorConditonal' that will take the same
args as SCLogError.

FatalError logs the error using SCLogError and then exits with return
code EXIT_FAILURE.

FatalErrorOnInit does the same only during init and with
--init-errors-fatal enabled, otherwise it just calls SCLogWarning. So
then the macro returns to the caller.

Implement this for output setup.
11 years ago
Victor Julien 45fc619f79 logging: json output
Make JSON output optional.

Cleanups.
11 years ago
Victor Julien b51c4e608f logging: optional colors output
Construct message per output method.
11 years ago
Victor Julien 1927b3000c output: cleanup 11 years ago
Victor Julien b30bdc21b5 logging: cleanup output API
Make SCLogMessage master of the logging. Reduces complexity
of the SCLog macro's.
11 years ago
Victor Julien d6fc6e874f log: reorganize SCLogOPIfaceCtx to make it more efficient 11 years ago
Eric Leblond 2be194d03f suricata: add -v[v] option to increase verbosity
This patch adds a -v option to suricata. It increases the log level
defined in the YAML.
13 years ago
Eric Leblond 4726e02afb logging: add warning if no output module is selected
If no daemon compatible logging module is selected, a message is
displayed to avoid the user to look like mad for messages.
14 years ago
Anoop Saldanha c22755fec5 fix cppcheck analyzer warnings - bug 439 15 years ago
Victor Julien 28e15be526 Clean up default output. Use simpler output format for releases. 15 years ago
Eric Leblond 1bebb9831d logging: don't display debug message before setting params. 15 years ago
Anoop Saldanha 420befb180 Changed my email address to anoopsaldanha at gmail dot com from my current one 15 years ago
Anoop Saldanha b819643635 coverity - logging system buffer overrun fix 15 years ago
Victor Julien dd97d136a9 Rearrange syslog.h including so we won't fail to build on win32. 15 years ago
Victor Julien 0d6d0ae371 Increase logline max length. 16 years ago
Eric Leblond 4e9231266a Compilation fix for OpenBSD and win32.
This patch fixes compilation on OpenBSD platform. It is running
fine on a pcap file. The patch should also fix compilation on
WIN32 platform but this is not tested.
16 years ago
Gurvinder Singh e5edc6e8e3 add the support to log the fast.log alerts type to syslog 16 years ago
William Metcalf ce01927515 Import of GPLv2 Header 050410 16 years ago
Victor Julien b7c089df42 Fix a couple of harmless compiler warnings. 17 years ago
Jan Jezek fe6a72befc Code is now compilable on the Win32 platform 17 years ago
Eric Leblond 84dfc0172a gcc warning fixes.
This patch fixes gcc warning:
    warning: suggest braces around empty body in an ‘if’ statement
This was the case in  when the macro SCLogDebug was used:
    if (ssn != NULL)
        SCLogDebug("ssn->alproto %"PRIu16"", ssn->alproto);

It also fixes a signed-unsigned comparison.
17 years ago
Anoop Saldanha 06a640e794 fix for bug #47 17 years ago
Anoop Saldanha a83f7abcc1 logging module bug 6 fix 17 years ago
Victor Julien b7bac14040 Fixup code to compile with -Wall -Werror -Wextra -Wno-unused-parameter compiler options. 17 years ago
Victor Julien 10cc9d5b6a Add icmp flow handling. 17 years ago
Jason Ish 28cad3429c An example of how logging could be configured from the log file. 17 years ago
Pablo Rincon 769022f4be Adding support for Mac OS X, FreeBSD, centrailizing mutex/spins/conditions in a macro API, and some unittests 17 years ago
Victor Julien 2cfa284999 Fix app layer detect to actually work. 17 years ago
Victor Julien 6346d1ddcf Add function name printing to the default output while we're still in development. 17 years ago
William Metcalf 0d13505f0e change debug code around to use global log dir 17 years ago