-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
log: Add module and subsystem identifiers to log #6023
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This changeset provides subsystem and module identifiers in the log when the log format string contains "%S". By convention, the log format surrounds "%S" with brackets. The subsystem name is generally the same as the thread name. The module name is derived from the source code module name and usually consists of the first one or 2 segments of the name using the dash character as the segment delimiter.
Temporary update to display config.log file on failure.
Address the issue with supplying the actual thread name for the thread formatting character `%m`. The subsystem identifier is a reliable proxy for the thread name and can be used here; it avoids the potential deadlock condition.
This commit converts the file logging logic to use JsonBuilder instead of libjansson.
jlucovsky
requested review from
jasonish,
victorjulien and
a team
as code owners
April 4, 2021 17:36
Codecov Report
@@ Coverage Diff @@
## master #6023 +/- ##
==========================================
- Coverage 76.91% 76.91% -0.01%
==========================================
Files 612 612
Lines 187721 187795 +74
==========================================
+ Hits 144391 144442 +51
- Misses 43330 43353 +23
Flags with carried forward coverage won't be shown. Click here to find out more. |
Continued in #6024 |
catenacyber
added a commit
to catenacyber/suricata
that referenced
this pull request
Jun 22, 2023
As it is part of the boundary Ticket: OISF#6023 On the way, look for urls even on incomplete lines
catenacyber
added a commit
to catenacyber/suricata
that referenced
this pull request
Jun 22, 2023
As it is part of the boundary Ticket: OISF#6023 On the way, look for urls even on incomplete lines
catenacyber
added a commit
to catenacyber/suricata
that referenced
this pull request
Jun 22, 2023
As it is part of the boundary Ticket: OISF#6023 On the way, look for urls even on incomplete lines
catenacyber
added a commit
to catenacyber/suricata
that referenced
this pull request
Jun 29, 2023
As it is part of the boundary Ticket: OISF#6023 On the way, look for urls even on incomplete lines
catenacyber
added a commit
to catenacyber/suricata
that referenced
this pull request
Jun 29, 2023
As it is part of the boundary Ticket: OISF#6023 On the way, look for urls even on incomplete lines
victorjulien
pushed a commit
to victorjulien/suricata
that referenced
this pull request
Jun 29, 2023
As it is part of the boundary Ticket: OISF#6023 On the way, look for urls even on incomplete lines
victorjulien
pushed a commit
to victorjulien/suricata
that referenced
this pull request
Jun 29, 2023
As it is part of the boundary Ticket: OISF#6023 On the way, look for urls even on incomplete lines
victorjulien
pushed a commit
to victorjulien/suricata
that referenced
this pull request
Jun 29, 2023
As it is part of the boundary Ticket: OISF#6023 On the way, look for urls even on incomplete lines
victorjulien
pushed a commit
to victorjulien/suricata
that referenced
this pull request
Jun 30, 2023
As it is part of the boundary Ticket: OISF#6023 On the way, look for urls even on incomplete lines
victorjulien
pushed a commit
to victorjulien/suricata
that referenced
this pull request
Jun 30, 2023
As it is part of the boundary Ticket: OISF#6023 On the way, look for urls even on incomplete lines
victorjulien
pushed a commit
to victorjulien/suricata
that referenced
this pull request
Jun 30, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Continuation of #6022
This changeset provides subsystem and module identifiers in the log when
the log format string contains
"%S"
. By convention, the log formatsurrounds
"%S"
with brackets.The subsystem name is generally the same as the thread name. The module
name is derived from the source code module name and usually consists of
the first one or 2 segments of the name using the dash character as the
segment delimiter.
Issue 2497: redmine
Updates:
Describe changes:
This PR adds a subsystem and module identifier to SCLog messages when the log format includes
%S
. Subsystem and module identifiers are intrinsic properties of threads and source code modules (respectively).New threads are assigned a subsystem identifier when the thread is created; the identifier is a Thread-Local-Storage variable declared in util-debug.c; values are assigned to it as threads are created using SCSetSubsystem (a macro defined in util-debug.h).
Module identifiers are derived from the source code module emitting the log message. A new CPP define
__SCFILENAME__
is assigned to_sc_module
(util-debug.h
) at compile time. Rust source module names are determined dynamically during the calls to the log function.Subsystem and module identifiers are added to log messages when the format contains
%S
. The generated log message will substitute a tag built fromRX#01
.The constructed tag is of the form
subsystem-id[:module-identifier]
(the brackets surrounding the module-identifier indicate the module-identifier is optional and are not included in the output; output formatting is strictly controlled by the log format in effect).Also, two travis related changes are included in this PR
#suricata-verify-pr:
#suricata-verify-repo:
#suricata-verify-branch:
#suricata-update-pr:
#suricata-update-repo:
#suricata-update-branch:
#libhtp-pr:
#libhtp-repo:
#libhtp-branch: