[mod_logfile] Add structured channel log tags#3077
Open
BIT-ja wants to merge 2 commits into
Open
Conversation
13 tasks
Changes: - Use single-evaluation assertions for event creation, channel tag access, and prefix configuration helpers. - Remove the ineffective event-reclaim teardown workaround. Bug Analysis: - Symptom: ASAN reported leaked events allocated by switch_event_create_plain() and switch_channel_get_log_tags(). - Root cause: fst_check_int_equals evaluates its first argument twice, so side-effecting calls allocated or duplicated an event twice and overwrote the first pointer. - Evidence: every leak stack points to a side-effecting call passed as the first argument; the teardown workaround left the leak count and stacks unchanged. - Fix: use fst_check(call() == expected), which evaluates the call once. - Risk: test-only assertion changes; production behavior is unchanged. Checkout Source: upstream/master Verification: - git diff --check passed. - GitHub ASAN CI reproduced the RED state and confirmed the teardown workaround was ineffective. - Green GitHub CI pending after push. Committer: Codex (GPT-5)
BIT-ja
force-pushed
the
feature/mod-logfile-structured-tags
branch
from
July 14, 2026 11:33
e5a6039 to
7455171
Compare
|
I already made my own module to set log tags but it behaves a bit differently. |
This file contains hidden or 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
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.
Description
Adds structured per-channel context to
mod_logfileoutput and aset_log_tagdialplan application.set_log_tag name=valuesets or replaces a channel log tag.set_log_tag name=andset_log_tag nameremove it.mod_logfilecan include captured tags and configured live channel variables in the prefix of each physical log line.The implementation also handles APR short writes, partial-error writes, transient reopen failures, HUP/rotation cleanup, allocation failures with raw fallback, and UTF-8-safe value sanitation.
Existing UUID behavior remains enabled by default.
log-tagsandchannel-varsare opt-in.Type of Change
Related Issues
None.
Testing
Validated in a Linux amd64 ASAN container:
make -j10switch_log: 4/4test_mod_logfile_prefix: 18/18test_mod_logfile: 2/2XML parsing and
git diff --checkAdded/updated unit tests
Tested manually
Tested with live SignalWire credentials (if applicable)
Checklist
Additional Notes
Example profile settings: