[RndTbl] apache logging full path of script run?

Adam Thompson athompso at athompso.net
Thu Mar 31 18:32:38 CDT 2016


http://httpd.apache.org/docs/current/mod/mod_log_config.html#formats

I *think* %f does what you want.  Not sure when it was introduced. If 
you need newer httpd on RHEL6, look at the "IUS" repositories run by 
Rackspace.
-Adam

On 16-03-31 06:06 PM, Trevor Cordes wrote:
> Does anyone know if you can make apache log the full path to a hit (i.e.
> script run or jpg served up).  It logs the basedir-relative path by
> default it seems:
>
> 52.10.199.91 - - [31/Mar/2016:18:02:16 -0500] "GET /index.phtml HTTP/1.1" 200 9024 "http://72.3.247.85:80" "Go-http-client/1.1"
>
> Instead of /index.phtml I'd like to see:
>
> /var/www/html/app1/index.phtml
>
> One might say, ah, but you know where index.phtml lives, so just use find
> or something.  In this case it doesn't help me because I serve up 1 of
> about 5 different index.phtml depending on whether the hit is https,
> "dev", "live", "demo" (hostname, vhosts, etc).
>
> I don't want to use separate log files, as I'd have a ton of them, and
> eyeballing them all for discrepancies would be a pain.
>
> Also, I think the "GET /index.phtml" doesn't even have to represent a
> file, I think that's just the raw URI.  I do use mod_rewrite a lot in some
> parts and it would be nice to have it log the final file it decides to
> serve up, not just the URI that might get hacked and mangled.
>
> Thanks!
> _______________________________________________
> Roundtable mailing list
> Roundtable at muug.mb.ca
> http://www.muug.mb.ca/mailman/listinfo/roundtable



More information about the Roundtable mailing list