 ######################
 #Functions Definition
 ######################
+
+
+
 #Format syslog TimeStamp
 formatSyslogDate = (unixtime) ->
   months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun','Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']

                            }
			    # Do something with the log ;)
#                            send_log(connection, JSON.stringify(message))
                            send_syslog(connection, formatSyslogDate(Date.now()), container, frame.content)
                        )
                    catch e
                        console.log 'could not parse packet: '.red + e.message

	socket.write msg

#used to send syslog message
send_syslog = (socket, host, port, proto, date, container, msg) ->
  criticity = 5
  facility = 1
  message = '<' + criticity + facility + '>' + date + ' ' + container.id.substr(0,12) + ' dockerlogger: ' + msg
  if (proto == 'tcp')
    socket.write(message)
  else if (proto == 'udp')
    console.log('Sending UDP log') 
    msg = new Buffer(message)
    socket.send(msg, 0, message.length, port, host)
    
#Attach to the container to get its logs
attach = (container) ->
    domain.create().on('error', (err) ->
