Skip to content
This repository has been archived by the owner. It is now read-only.
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

aTech Log Server

This simple service will run a centralised log server which can receive messages over UDP from applications and store them in a file.

Requirements

  • You must have Ruby install on your host (1.8.7 or 1.9.3 are currently supported)
  • An internet connection

Installing & running the log server

git clone https://github.com/atech/log-server.git /opt/log-server
ln -s /opt/log-server/upstart.conf /etc/init/log-server.conf
start log-server

All logs by default are stored in /opt/log-server/logs/app_name/log_name.log.

Sending a log message to the server

The following code outlines how to send a message to the log server. You should replace 1.2.3.4 with the IP address of your installed log server.

app_name  = 'sirportly'
log_name  = 'workers'
message   = "Hello there! This is a test of my log server..."
socket    = UDPSocket.new
data      = [app_name.bytesize, app_name, log_name.bytesize, log_name, message.bytesize, message, 0].pack('nA*nA*nA*n')
socket.send(data, 0, '1.2.3.4', 4455)

This works well with our log server IO class which can easily be used with loggers.

logger = Logger.new(Atech::NetworkLogIO.new(:host => '1.2.3.4', :app_name => 'demo', :log_name => 'app'))

About

Our simple UDP centralised log server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages