Giter Site home page Giter Site logo

cloudwatchlogger's People

Contributors

coderbydesign avatar dlobatog avatar equivalent avatar github-actions[bot] avatar laurelolson avatar luizkowalski avatar mgz avatar nbudin avatar rlogman-topstep avatar zshannon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cloudwatchlogger's Issues

No implicit conversion of Symbol into Integer

With the release 0.3.0, our apps started crashing there (looks like it's related to #12)

#<CloudWatchLogger::Client::AWS_SDK::DeliveryThread:0x000055d9d76eadf0@/usr/share/gems/gems/cloudwatchlogger-0.3.0/lib/cloudwatchlogger/client/aws_sdk/threaded.rb:49 run> terminated with exception (report_on_exception is true):
--
  | /usr/share/gems/gems/cloudwatchlogger-0.3.0/lib/cloudwatchlogger/client/aws_sdk/threaded.rb:61:in `[]': no implicit conversion of Symbol into Integer (TypeError)
  | from /usr/share/gems/gems/cloudwatchlogger-0.3.0/lib/cloudwatchlogger/client/aws_sdk/threaded.rb:61:in `block (2 levels) in initialize'
  | from /usr/share/gems/gems/cloudwatchlogger-0.3.0/lib/cloudwatchlogger/client/aws_sdk/threaded.rb:50:in `loop'
  | from /usr/share/gems/gems/cloudwatchlogger-0.3.0/lib/cloudwatchlogger/client/aws_sdk/threaded.rb:50:in `block in initialize'

Is it something new we have to set somewhere or is it a bug?

cc @coderbydesign @zshannon

Hash logger logs as string

Hello!

According to a section in Readme, i should be able to convert hash to cloudwatch "tags". So using Rails.logger.info :boom => :box should produce a x=y, z=q, boom=boxlog entry. However, it produces a following entry:

image

So basically hash gets converted into a string and gets logged as a regular @message. Am i doing something wrong? That's my first contact with CloudWatch as a rails logging provider so maybe i misunderstand something. Thanks in advance for any help!

Better configuration

Right now, this is how we configure the library:

log = CloudWatchLogger.new({access_key_id: 'YOUR_ACCESS_KEY_ID', secret_access_key: 'YOUR_SECRET_ACCESS_KEY'}, 'YOUR_CLOUDWATCH_LOG_GROUP')

This is far from ideal because:

  1. we have a option params (the hash with access keys) before
  2. it is not clear what the params means without reading the code

The solution I see is introduce a configuration block, e.g.

CloudwatchLogger.configure do |config|
  config.aws_key = xxx
  config.aws_secret = xxx
  config.log_group = xxxx
end

and have an instance of CloudwatchLogger saved into CloudwatchLogger.current (pretty much like Redis gem is doing)

Ideas? Opinions?

JSON log format

In Client#formatter, there is a conditional that checks if @format = :json && msg.is_a?(Hash). If this is true, the message is logged as a JSON object, otherwise it is logged as a string.

There currently does not seem to be a way to set @format so the log is always a string. This means the CloudWatch "Discovered Fields" feature does not discover the keys within the JSON object.

Is there anyway to turn of Time, Pid, Thread and Severity, need the space?

Hi big fan of the gem but due to the volume of logs I need to fit more information onto the first line of the log as shown in cloudwatch. As cloudwatch already logs the time and the other automatic fields are not useful to the information I want to log I was hoping there was a way to turn them off?

many thanks,
Simon

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.