Bug 64232

Summary: tux2w3c doesn't display correct output of TUX log
Product: [Retired] Red Hat Linux Reporter: David Morse <david_j_morse>
Component: tuxAssignee: Ingo Molnar <mingo>
Status: CLOSED RAWHIDE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3CC: johnsonm
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-04-30 21:13:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Fixes timezone truncation, shows status & bytes sent in common log mode none

Description David Morse 2002-04-29 22:38:01 UTC
Description of problem:
tux2w3c in tux-2.2.5-1 does not display all the HTTP headers correctly, i.e. no HTTP status code, no bytes sent.  Running tux2w3c from tux-2.2.0-1 displays the log correctly, so the problem is in the user-space tux2w3c conversion program.

Version-Release number of selected component (if applicable): 2.2.5-1


How reproducible:
Always

Steps to Reproduce:
1. Start TUX with logging enabled
2. /usr/sbin/tux2w3c /var/log/tux

Actual Results:  From tux-2.2.5-1:
127.0.0.1 - - [29/Apr/2002:17:31:22 -040] "GET /index/html HTTP/1.1" "-" ""
127.0.0.1 - - [29/Apr/2002:17:31:34 -040] "GET /index.html HTTP/1.1" "-" ""

Expected Results:  From tux-2.2.0-1:
127.0.0.1 - - Mon Apr 29 17:31:22 2002 "GET /index/html HTTP/1.1" - 0 404
127.0.0.1 - - Mon Apr 29 17:31:34 2002 "GET /index.html HTTP/1.1" - 2890 200

Comment 1 Ingo Molnar 2002-04-30 09:35:51 UTC
we switched the default tux2w3c output to be that of Apache's, so that log
analyzer software can parse it. There is a new option, -b, which should give you
the old-style format - does that fix the problem for you?


Comment 2 David Morse 2002-04-30 14:20:07 UTC
The -b option shows the old-style output with the correct headers; however, the 
Apache style is broken.

[root@pe1650 root]# tux2w3c -b /var/log/tux
127.0.0.1 - - Mon Apr 29 17:31:22 2002 "GET /index/html HTTP/1.1" - 0 404
127.0.0.1 - - Mon Apr 29 17:31:34 2002 "GET /index.html HTTP/1.1" - 2890 200

[root@pe1650 root]# tux2w3c /var/log/tux
127.0.0.1 - - [29/Apr/2002:17:31:22 -040] "GET /index/html HTTP/1.1" "-" ""
127.0.0.1 - - [29/Apr/2002:17:31:34 -040] "GET /index.html HTTP/1.1" "-" ""

[root@pe1650 root]# cat /var/log/httpd/access_log 
127.0.0.1 - - [30/Apr/2002:09:11:43 -0400] "GET /index/html HTTP/1.1" 404 294 "-
" "Elinks (0.3; Linux 2.4.18-3smp i686)"
127.0.0.1 - - [30/Apr/2002:09:12:11 -0400] "GET /index.html HTTP/1.1" 200 
2890 "-" "Elinks (0.3; Linux 2.4.18-3smp i686)"

The Apache style includes HTTP status, bytes sent, and User-Agent.  While the 
User-Agent is not as important, I think the first two are.  It also appears the 
timezone is missing a trailing 0, i.e. -040 shold be -0400.


Comment 3 David Morse 2002-04-30 21:07:41 UTC
Created attachment 55945 [details]
Fixes timezone truncation, shows status & bytes sent in common log mode

Comment 4 David Morse 2002-04-30 21:13:53 UTC
I've attached a patch to fix the problems reported above and verified that 
extended log format did not break.

First fix only truncates last byte if time obtain via ctime() (which adds a 
\n); in combined mode it was truncating the last digit of the timezone 
obtained via strftime().

Second fix is to print HTTP status and bytes sent, regardless of whether 
extended logging mode was used.


Comment 5 Ingo Molnar 2002-05-05 13:44:25 UTC
okay, fix is in CVS, tarball uploaded.