Bug 40586 - Add option to supress default '-' output
Summary: Add option to supress default '-' output
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_log_config (show other bugs)
Version: 2.5-HEAD
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2006-09-22 18:49 UTC by Matthew Kent
Modified: 2007-06-21 11:25 UTC (History)
0 users



Attachments
add ^ modifier (2.01 KB, patch)
2006-09-22 18:50 UTC, Matthew Kent
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Kent 2006-09-22 18:49:57 UTC
Quick patch for mod_log_config to add a '^' modifier which suppresses the
default output of '-' by process_item whenever it gets a NULL back from a
LogFormat item, outputting an empty string instead.

eg: LogFormat "url: \"%^U\"\n referer: \"%^{Referer}i\"\n agent:
\"%^{User-Agent}i\"" sample

This allows users to solve some ambiguity with items like \"%{Referer}i\" or
\"%{User-Agent}i\" where "-", although rather useless, is a valid referrer if it
was passed in and should treated as such by a log processing program, instead of
being thrown away because it represents an empty value. 

Plus it eliminates the need for anyone writing a log processor to dig through
the code to determine what might happen to output a '-' indicating a non
existent value and handle it accordingly.

Will submit a documentation patch if accepted.
Comment 1 Matthew Kent 2006-09-22 18:50:25 UTC
Created attachment 18899 [details]
add ^ modifier