On 13/07/2014 19:59, Steve Vinoski wrote:

This could be done via the logger_mod setting in the server configuration, which is described in the Yaws PDF documentation (http://yaws.hyber.org/yaws.pdf) as well as the yaws_config man page (http://yaws.hyber.org/yman.yaws?page=yaws.conf). I've included the text from the PDF doc below. Since Combined logging is the same as Common but with two extra fields, the implementation could probably just reuse much of yaws_log.

--steve

Hello Steve,

Thanks for your answer. I was ready indeed to "fork" yaws_log.erl into a new yaws_combined_log.erl but then I saw that the logic to handle referer and user agent was already there in the original file.

And indeed when generating some logs:

"""
192.168.0.11 - - [12/Jul/2014:10:12:11 +0200] "GET /main/MainMenu.html HTTP/1.1" 304 0 "http://XX.YY.com/main/ZZ.html" "Mozilla/5.0 (X11; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0"
"""

one can see that the two last fields are already there. So, according to http://awstats.sourceforge.net/docs/awstats_faq.html#PERSONALIZEDLOG Yaws seems to already outputĀ  "NCSA combined/XLF/ELF" rather than "NCSA common CLF" log format.

So I guess that actually the only change that should happen would be a doc update; namely in http://yaws.hyber.org/yman.yaws?page=yaws.conf the paragraph

"""
<Host>.access - for each virtual host served by Yaws, a file <Host>.access will be written which contains an access log in Common Log Format. (See http://en.wikipedia.org/wiki/Com- mon_Log_Format for more details on Common Log Format.)
"""

should become something like:

"""
<Host>.access - for each virtual host served by Yaws, a file <Host>.access will be written which contains an access log in NCSA combined/XLF/ELF log format (See FIXME_URL for more details on this format.)
"""

The FIXME_URL could be http://httpd.apache.org/docs/2.4/logs.html, http://publib.boulder.ibm.com/tividd/td/ITWSA/ITWSA_info45/en_US/HTML/guide/c-logs.html#combined or http://awstats.sourceforge.net/docs/awstats_faq.html#PERSONALIZEDLOG (unfortunately I could not find a proper definition thereof in www.w3.org or in Wikipedia).

Hope this helps,
Best regards,

Olivier.


-- 
Olivier Boudeville