Skip to content

log: per-module LogLevel now applies to all of mod_crowdsec's log lines - #27

Merged
sabban merged 1 commit into
mainfrom
fix/aplog-use-module
Oct 22, 2026
Merged

sabban merged 1 commit into
mainfrom
fix/aplog-use-module

Conversation

@sabban

@sabban sabban commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Issue

Only mod_crowdsec.c declared the module, through AP_DECLARE_MODULE. Lines logged from the other files (poller, store, metrics, AppSec, config) showed up as [:info] and ignored per-module log levels. As a result, LogLevel warn crowdsec:info, the setup the README documents, did not show the poller and store messages.

Fix

APLOG_USE_MODULE(crowdsec); in crowdsec_{appsec,config,lapi,metrics,poller}.c. It is not added to mod_crowdsec.c, which already gets it from AP_DECLARE_MODULE; a second declaration fails to compile.

Tested

Built with no warnings and make check passes. On a live Debian 13 host with LogLevel warn crowdsec:info:

  • before: 0 crowdsec lines in the error log
  • after: the poller and metrics lines appear, tagged [crowdsec:info]. crowdsec_module:info works as well.

🤖 Generated with Claude Code

Only mod_crowdsec.c got a module index, from AP_DECLARE_MODULE. Lines
logged from the other files - the poller, the store, metrics, AppSec,
config - were tagged [:level] and ignored per-module log levels, so
"LogLevel warn crowdsec:info" (as documented in the README) showed none
of them. APLOG_USE_MODULE(crowdsec) in each of those files fixes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sabban
sabban merged commit b0c08eb into main Oct 22, 2026
15 checks passed
@sabban
sabban deleted the fix/aplog-use-module branch October 22, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants