Skip to content

Commit

Permalink
reduce logging at info level (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsvd authored and Suyog Rao committed Sep 15, 2016
1 parent e33e1cd commit 623e2a4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,6 @@
## 3.0.3
- Move some log messages from info to debug to avoid noise

## 3.0.2
- Relax constraint on logstash-core-plugin-api to >= 1.60 <= 2.99

Expand Down
10 changes: 5 additions & 5 deletions lib/logstash/outputs/cloudwatch.rb
Expand Up @@ -165,7 +165,7 @@ def register
@event_queue = SizedQueue.new(@queue_size)
@scheduler = Rufus::Scheduler.new
@job = @scheduler.every @timeframe do
@logger.info("Scheduler Activated")
@logger.debug("Scheduler Activated")
publish(aggregate({}))
end
end # def register
Expand All @@ -188,14 +188,14 @@ def receive(event)
@logger.warn("Posted to AWS CloudWatch ahead of schedule. If you see this often, consider increasing the cloudwatch queue_size option.")
end

@logger.info("Queueing event", :event => event)
@logger.debug("Queueing event", :event => event)
@event_queue << event
end # def receive

private
def publish(aggregates)
aggregates.each do |namespace, data|
@logger.info("Namespace, data: ", :namespace => namespace, :data => data)
@logger.debug("Namespace, data: ", :namespace => namespace, :data => data)
metric_data = []
data.each do |aggregate_key, stats|
new_data = {
Expand Down Expand Up @@ -227,7 +227,7 @@ def publish(aggregates)
:namespace => namespace,
:metric_data => batch
)
@logger.info("Sent data to AWS CloudWatch OK", :namespace => namespace, :metric_data => batch)
@logger.debug("Sent data to AWS CloudWatch OK", :namespace => namespace, :metric_data => batch)
rescue Exception => e
@logger.warn("Failed to send to AWS CloudWatch", :exception => e, :namespace => namespace, :metric_data => batch)
break
Expand All @@ -239,7 +239,7 @@ def publish(aggregates)

private
def aggregate(aggregates)
@logger.info("QUEUE SIZE ", :queuesize => @event_queue.size)
@logger.debug("QUEUE SIZE ", :queuesize => @event_queue.size)
while !@event_queue.empty? do
begin
count(aggregates, @event_queue.pop(true))
Expand Down
2 changes: 1 addition & 1 deletion logstash-output-cloudwatch.gemspec
@@ -1,7 +1,7 @@
Gem::Specification.new do |s|

s.name = 'logstash-output-cloudwatch'
s.version = '3.0.2'
s.version = '3.0.3'
s.licenses = ['Apache License (2.0)']
s.summary = "This output lets you aggregate and send metric data to AWS CloudWatch"
s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
Expand Down

0 comments on commit 623e2a4

Please sign in to comment.