Conversation
halkt
marked this pull request as draft
September 18, 2026 14:48
The "[Crowdsec] denied '<ip>' with '<remediation>'" line emitted on every bounced request is hardcoded to ngx.ALERT in csmod.Allow(). alert is more severe than error, so nginx writes it at every practical error_log level; the only way to keep it out of the error log is `error_log ... emerg;`, which also silences nginx's own errors and real bouncer failures such as "failed to query LAPI" or "Lua shared dict is full". Since the line is emitted once per bounced request, its volume is unbounded exactly when the bouncer is doing its job, and operators shipping the error log elsewhere have no way to opt out of it. Add a BOUNCING_LOG_LEVEL option taking the nginx error_log severity names. The name is resolved to the matching ngx.* constant once in csmod.init(), so the hot path stays a plain field read. Unknown values fall back to the default with a warning, matching the other enum-like options in config.lua. The default is "alert", i.e. current behaviour, so this is a no-op unless the option is set.
halkt
force-pushed
the
feat/bouncing-log-level
branch
from
September 18, 2026 14:49
1c652a1 to
e1e35de
Compare
halkt
marked this pull request as ready for review
September 18, 2026 14:51
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.
Hello,
Adds a
BOUNCING_LOG_LEVELoption so you can choose the log level the bouncer useswhen it blocks a request. The default is
alert, which is what it does today, sonothing changes unless you set it.
We run this bouncer on a site with a lot of traffic. It writes one line every time it
blocks a request. We send our nginx error log to an external service, and those lines
alone are a big part of what we pay for it. On our side a block is normal and expected,
so it is closer to info than to an error.
Today we cannot lower just those lines.
error_logsets one level for all of nginx.That is why we would like to be able to choose this level.