 				)
 	.tap ->
 		utils.mixpanelTrack('Application start', app.imageId)
+		logSupervisorEvent('Starting application ' + app.imageId)
 	.finally ->
 		updateDeviceInfo(status: 'Idle')
 

		channel = "device-#{uuid}-logs"

		# Redefine original function
		publish = (message) ->
			# Stop pubnub logging loads of "Missing Message" errors, as they are quite distracting
			message or= ' '
			pubnub.publish({ channel, message })

		# Replay queue now that we have initialised the publish function
		publish(args...) for args in publishQueue

	return -> publishQueue.push(arguments)

exports.kill = kill = (app) ->
	utils.mixpanelTrack('Application kill', app)
	updateDeviceInfo(status: 'Stopping')
	container = docker.getContainer(app.containerId)

					localApp = apps[imageId]
					app = remoteApps[imageId]
					utils.mixpanelTrack('Application update', app)
					logSupervisorEvent('Updating application')
					kill(localApp)
					.then ->
						start(app)
