Logstalgia: Nginx access log in real time

Logstalgia (aka ApachePong) is a website tool that will help you to visualize the [embedded content] in a cool and better looking way than the tradditional logs. Basically it reads the access_log and generates a graphic pong-like game between the webserver (Nginx, Apache or Lighttpd) and your clients http requests. To give you a better idea of what Logstalgia can do, let’s watch this video:

Logstalgia Requirements

  • A busy Nginx web server already working.
  • Linux OS (Fedora, Ubuntu, etc).
  • PC/Notebook or Server with OpenGL video support.

Installing Logstalgia

On Fedora / CentOS

 yum install SDL-devel SDL_image-devel ftgl-devel pcre-devel libpng-devel libjpeg-devel gcc-c++ make gcc glew glew-devel boost boost-devel  wget https://github.com/acaudwell/Logstalgia/releases/download/logstalgia-1.0.5/logstalgia-1.0.5.tar.gz tar -xvpzf logstalgia-1.0.5.tar.gz  cd logstalgia-1.0.5 ./configure make make install

On Ubuntu/Debian

apt-get install logstalgia

Logstalgia + Nginx

There is no configuration needed in fact, the only thing you need to do is run logstalgia against the nginx access_log, example:

logstalgia [options] /var/log/nginx/access_log


logstalgia [options] /etc/nginx/logs/access_log

It all depends on where you have your access logs located.

To see all other supported options:

logstalgia --help

Watch Nginx access.log from a remote desktop o server

ssh [email protected] tail -f /path/of/your/access.log | logstalgia --sync

Replace XX.XX.XX.XX with your server public/private IP address. And replace “/path/of/your/access.log” with the real path of your Nginx logs, which is usually /var/log/nginx/access.log or /etc/nginx/logs/access.log

Save logstalgia output as a video file

If you want to save those nice looking logs into a video, then run this command:

logstalgia -1280x720 --output-ppm-stream myvideo.ppm /var/log/httpd/access.log

Finally, you need to convert your logstalgia .ppm file into a .mp4 video file using ffmpeg tool:

ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i myvideo.ppm -vcodec libx264 -preset ultrafast -pix_fmt yuv420p -crf 1 -threads 0 -bf 0 nginx.accsess.log.mp4