 #
 #  Example broadcast for an Exit timeout alert:
 #
-#    "Logentries (Production Alert): Exit timeout"
+#    "[<Your Logentries App Name> Logs]: Exit timeout"
 #
 # Dependencies:
 #   None

#
#        {
#            "alert": {
#                "name": "500 error" // Alert name
#            },
#            "host": {
#                "name": "Web", // Host name
#                "hostname": "web.example.com" // Host DNS name
#            },
#            "log": {
#                "name": "access.log" // Log name
#            },
#            "event": <event hash>, // Trigerring event
#            "context": [ // Events in context
#                <event hashes>
#            ]
#        }

# TODO: move rooms into request path: hubot/<room-numbers>/logentries/
#       as to not require the ENV var.

module.exports = (robot) ->
  robot.router.post "/hubot/logentries", (req, res) ->

        user.room = process.env.LOGENTRIES_ROOM
      user.type = 'groupchat'

      robot.send user, "[#{name} Logs]: #{alert}"

      res.writeHead 200, {'Content-Type': 'text/plain'}
      res.end 'Thanks\n'
