Sha256: 11b59574de0215dde7ffd3227fea824f78cf34e1614f01b5cd3a4d37f7d9f855
Contents?: true
Size: 743 Bytes
Versions: 1
Compression:
Stored size: 743 Bytes
Contents
require "log4r/outputter/outputter" require "json" module Log4r class DeploymentTrackerOutputter < Outputter def initialize(name, hash = {}) super(name, hash) @logger = Log4r::Logger.new("vagrant_orchestrate::log4r::deployment_tracker_outputter") end private def canonical_log(event) data = {} data["type"] = event.fullname data["timestamp"] = Time.now.getutc.iso8601 data["level"] = LNAMES[event.level] data["message"] = event.data begin id = VagrantPlugins::Orchestrate::DEPLOYMENT_ID DeploymentTrackerClient::DefaultApi.post_logs(id, data) rescue @logger.warn "Unable to send log messages to deployment-tracker" end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
vagrant-orchestrate-0.7.0.pre.2 | lib/log4r/outputter/deployment_tracker_outputter.rb |