virtuoso-opensource icon indicating copy to clipboard operation
virtuoso-opensource copied to clipboard

HTTP log stopped after adding "%T" to HTTP log config

Open Ztomepic opened this issue 2 years ago • 3 comments

I need detailed information about time taken to execute each query on virtuoso. So I activated HTTP log. All seems good until I set %T in virtuoso.ini, from when HTTP log is not produced anymore.

I use Virtuoso Open Source 7.2.9. My HTTP log related config in virtuoso.ini:

HTTPLogFile= /datatestsc/kg/log/vos21082023.log
HTTPLogFormat= #-#kgType:Virtuoso#-#kgServerIp:10.70.50.114#-#kgQuerySrcIp:%h#-#%u#-#kgQueryStartTime:%t#-# kgQueryContent:"%r"#-#kgQueryStatus:%s#-#kgQueryResultCt:%b#-#kgQuerySrc:"%{Referer}i"#-#kgQueryDur:%T#-# "%{User-agent}i" "%{NetId}e"

Related logs in virtuoso.log

16:10:06 The HTTP Log format is wrong, can't log requests

Does that mean %T is not supported in Virtuoso HTTP log? If so, how may I print time cost for each request?

Ztomepic avatar Aug 21 '23 02:08 Ztomepic

The first thing I notice is a line-break in your HTTPLogFormat value, which may just be a relic of your pasting it to GitHub.

HTTPLogFormat= ...#kgQuer
yStatus...

If this line-break is really in your virtuoso.ini, that could explain the error you're seeing. Make sure that setting has no line-break, as here --

HTTPLogFormat= #-#kgType:Virtuoso#-#kgServerIp:10.70.50.114#-#kgQuerySrcIp:%h#-#%u#-#kgQueryStartTime:%t#-# kgQueryContent:"%r"#-#kgQueryStatus:%s#-#kgQueryResultCt:%b#-#kgQuerySrc:"%{Referer}i"#-#kgQueryDur:%T#-# "%{User-agent}i" "%{NetId}e"

TallTed avatar Aug 21 '23 16:08 TallTed

This line-break is a pasting problem. It is not really in my virtuoso.ini file. I've edited the issue post to make it right.

Ztomepic avatar Aug 21 '23 16:08 Ztomepic

Having reviewed source and confirmed with Development, I've confirmed that %T is among the escapes we don't (yet) support, as noted in the manual:

Note that not all escapes from Apache Module mod_log_config are supported.

At the moment, this classes as a nice-to-have, which may be implemented at some point, but is fairly low on the list of things to do. That could change if there were a stronger business case, whether a custom development contract for you or a relatively large number of users asking for the same feature.

That said, perhaps there's another way to achieve your goal. To that end, what are you really trying to achieve?

The only reason we can think of for putting query execution times into a logfile would be profiling, so you may find what you're wishing for in the Query Logging section of the manual. Please let us know if that will serve!

TallTed avatar Aug 31 '23 13:08 TallTed