feat: add USE_EXTENDED_LOGFORMAT support for Apache variants#410
Draft
feat: add USE_EXTENDED_LOGFORMAT support for Apache variants#410
Conversation
Co-authored-by: fzipi <3012076+fzipi@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Consider using extended format for logging
Add USE_EXTENDED_LOGFORMAT support for Apache variants
Mar 1, 2026
Member
|
@theseion Does this make sense? Or we prefer an approach similar to the one used in METRICSLOG? |
Contributor
|
I don't know what you mean by "similar to the one used by METRICSLOG". The only difference is that the metrics log format is configurable, but then, it's also a dedicated directive, whereas this new variable would override I think it's a good idea but I would call the variable something else, that makes it clear that this is a format optimized for ModSecurity log analysis, e.g., |
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.
Adds opt-in support for the extended Apache log format — which surfaces ModSecurity anomaly scores, timing breakdowns, SSL details, and more — via a new
USE_EXTENDED_LOGFORMATvariable. Only applies toapacheandapache-alpine; nginx does not support the required env variable expansions.Changes
apache/Dockerfile/apache/Dockerfile-alpine: AddUSE_EXTENDED_LOGFORMAT=falseENV defaultapache/docker-entrypoint.sh: WhenUSE_EXTENDED_LOGFORMAT=true, overrideAPACHE_LOGFORMATbefore Apache starts sohttpd-modsecurity.conf'sLogFormat ${APACHE_LOGFORMAT} modsecpicks up the extended formatREADME.md: Document new variable under Apache ENV VariablesUsage
Resulting log format:
Setting
USE_EXTENDED_LOGFORMAT=truetakes precedence over any customAPACHE_LOGFORMATvalue.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.