Skip to content

Instantly share code, notes, and snippets.

@spuder
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spuder/22ed92099f3cfe82316b to your computer and use it in GitHub Desktop.
Save spuder/22ed92099f3cfe82316b to your computer and use it in GitHub Desktop.
Gitlab + Logstalgia
# The client must have an x11 window running (for the graphics)
ssh foo@192.0.2.0 tail -f /home/foo/logstalgia.log | logstalgia --sync
Verify that the logstalgia-client can ssh to the logstalgia-server without passwords by setting up ssh key access
# On the logstalia server, make sure the logstalgia-client can access with ssh keys
Verify that there is a file in ~/logstalgia.log
Theoretically you could link the logstalgia-client directly to the web-server, however this is less secure since the client could be compromised. By using a logstalgia server, if the client is compromised an attacker could only recover some logs.
It also gives us the advantage of sending multiple webservers to one logstalia log file.
# On the web server, tail the logs like so:
#!/usr/bin/env bash
tail -f /var/log/nginx/gitlab_access.log -f /var/log/nginx/gitlab_error.log -f /var/log/nginx/access.log -f /var/log/nginx/error.log | ssh foo@192.0.2.0 " cat >> logstalgia.log"
Also setup ssh key access from gitlab-server to logstalgia log server
ssh-copy-id -i ~/.ssh/id_rsa.pub foo@logstalgia-server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment