RedHatInsights / insights-api-common-rails

Header, Encryption, RBAC, Serialization, Pagination and other common behavior for Insights microservices built with Rails
Apache License 2.0
3 stars 25 forks source link

Use insights logger gem #225

Closed lpichler closed 3 years ago

lpichler commented 3 years ago

This PR replaces manageiq-loggers gem with insights-loggers-ruby gem.

Usage is proper in rails applications:

app_name = "sources-api"
Insights::API::Common::Logging.activate(config, app_name)
  1. This changes allows to support haberdasher and in order to use haberdasher, LOG_HANDLER environment variable needs to be set:

    ENV['LOG_HANDLER'] = 'haberdasher'

    app_name - optional parameter to set app_name - which is need for identification of source log message and it will be visible in tags and labels.

  2. Uses logger Insights::Loggers::CloudWatch instead of ManageIQ::Loggers::CloudWatch. Insights::Loggers::CloudWatch we can control log levels:

    • container logger by ENV['CONTAINER_LOG_LEVEL']
    • CloudWatch logger by ENV['LOG_LEVEL']

Links

https://issues.redhat.com/browse/RHCLOUD-13925

dippy-bot commented 3 years ago

Checked commit https://github.com/lpichler/manageiq-api-common/commit/42a5022f5a8c24ff6fb1ed4b5ecc85963ab4a1db with ruby 2.5.7, rubocop 0.82.0, haml-lint 0.35.0, and yamllint 2 files checked, 0 offenses detected Everything looks fine. :cookie: