rsvp icon indicating copy to clipboard operation
rsvp copied to clipboard

Logging not working

Open agemmell opened this issue 12 years ago • 10 comments
trafficstars

Hello!

Okay, so I'm trying to get the logging to work. Your CGI scripts, such as "startlog" uses the command "varnishlog -D -c -m ReqStart:$REMOTE_ADDR -w /var/rsvp/www/logs/$REMOTE_ADDR.log".

For me $REMOTE_ADDR seems to be empty, so the command doesn't do anything because it's now just "varnishlog -D -c -m ReqStart: -w /var/www/rsvp/www/logs/.log"

What am I missing?

agemmell avatar May 08 '13 20:05 agemmell

That's weird. $REMOTE_ADDR is used so that you get only the log for you own requests. If you remove it it will work but you'll get all requests.

benjaminbellamy avatar May 08 '13 21:05 benjaminbellamy

Hmmm... so is $REMOTE_ADDR a fairly standard variable on linux systems? Where does it get set?

agemmell avatar May 08 '13 21:05 agemmell

It's a cgi environment variable. It is set by Apache. (It won't work if you run the script from a terminal)

benjaminbellamy avatar May 08 '13 21:05 benjaminbellamy

Yeah, that was confusing me. I thought it might be Apache related.

I just added a quick test CGI script (my first!) to output some variables. This was the output:

SERVER_SOFTWARE = Apache/2.2.22 (Ubuntu) SERVER_NAME = rsvp.vm GATEWAY_INTERFACE = CGI/1.1 SERVER_PROTOCOL = HTTP/1.1 SERVER_PORT = 8989 REQUEST_METHOD = GET HTTP_ACCEPT = text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8 PATH_INFO = PATH_TRANSLATED = SCRIPT_NAME = /cgi-bin/test.bat QUERY_STRING = REMOTE_HOST = REMOTE_ADDR = 192.168.80.1 REMOTE_USER = AUTH_TYPE = CONTENT_TYPE = CONTENT_LENGTH =

REMOTE_ADDR is there although other variables aren't but hopefully they aren't important.

So I re-ran the command from the command line with the remote address substituted in: varnishlog -D -c -m ReqStart:192.168.80.1 -w /var/rsvp/www/logs/192.168.80.1.log

... and nothing happens. I check to see if a varnishlog process is running (ps aux | grep varnishlog) but nothing is running.

I tried simply running "varnishlog" to start a log running from the command line and it definitely works.

Any ideas?

agemmell avatar May 08 '13 21:05 agemmell

FYI I tested running "varnishlog -c -m ReqStart:192.168.80.1" and it worked as expected - only showing log information when I browsed my target website that gets served via Varnish.

agemmell avatar May 08 '13 21:05 agemmell

What does your Apache error log say?

benjaminbellamy avatar May 08 '13 21:05 benjaminbellamy

Good idea, check the error logs... facepalm

[Wed May 08 14:32:38 2013] [error] [client 192.168.80.1] kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec], referer: http://rsvp.vm:8989/logs.html

agemmell avatar May 08 '13 21:05 agemmell

Which Linux distrib are you using?

benjaminbellamy avatar May 08 '13 21:05 benjaminbellamy

Ubuntu 12.10

Linux rsvp.vm 3.5.0-27-generic #46-Ubuntu SMP Mon Mar 25 19:58:17 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

It's a VirtualBox VM.

agemmell avatar May 08 '13 21:05 agemmell

I'm afraid I'm still at a loss as to why this isn't working. Did you ever manage to look in to this at all?

agemmell avatar May 16 '13 22:05 agemmell