Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add lograge to improve logging #5423

Merged
merged 13 commits into from
Apr 7, 2023
Merged

Conversation

vishnu-narayanan
Copy link
Member

@vishnu-narayanan vishnu-narayanan commented Sep 12, 2022

Pull Request Template

Description

  • Add lograge gem to improve rails logging
  • Single line log for requests in JSON formatting
  • Swtich sidekiq to also use JSON formatting

Fixes https://github.com/chatwoot/product/issues/437

Before

16:56:25 backend.1  | Started GET "/app/accounts/1/dashboard" for 127.0.0.1 at 2022-09-15 16:56:25 +0530
16:56:25 backend.1  | Processing by DashboardController#index as HTML
16:56:25 backend.1  |   Parameters: {"params"=>"accounts/1/dashboard"}
16:56:25 backend.1  |   Rendered dashboard/index.html.erb within layouts/vueapp (Duration: 0.1ms | Allocations: 4)
16:56:25 backend.1  |   Rendered layout layouts/vueapp.html.erb (Duration: 130.3ms | Allocations: 16320)
16:56:25 backend.1  | Completed 200 OK in 162ms (Views: 130.9ms | ActiveRecord: 0.5ms | Allocations: 19923)

After

16:56:25 backend.1  | {"method":"GET","path":"/app/accounts/1/dashboard","format":"html","controller":"DashboardController","action":"index","status":200,"duration":161.72,"view":130.9,"db":0.49,"level":INFO,"host":"127.0.0.1","ip":"127.0.0.1","user_id":1}

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Tested locally and in qa environment

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@pr-triage pr-triage bot added the PR: draft label Sep 12, 2022
@vishnu-narayanan vishnu-narayanan temporarily deployed to qa-chatwoot September 12, 2022 10:49 Inactive
@vishnu-narayanan vishnu-narayanan temporarily deployed to qa-chatwoot September 12, 2022 13:47 Inactive
@vishnu-narayanan vishnu-narayanan temporarily deployed to qa-chatwoot September 15, 2022 10:59 Inactive
@vishnu-narayanan vishnu-narayanan temporarily deployed to qa-chatwoot September 15, 2022 11:18 Inactive
@vishnu-narayanan vishnu-narayanan marked this pull request as ready for review September 15, 2022 11:30
@sojan-official sojan-official self-assigned this Oct 11, 2022
@github-actions
Copy link

🐢 Turtley slow progress alert! This pull request has been idle for over 30 days. Can we please speed things up and either merge it or release it back into the wild?

@github-actions github-actions bot added the stale label Jan 20, 2023
@scmmishra
Copy link
Member

@vishnu-narayanan is this PR still relevant? Lets merge this if it is

@sojan-official
Copy link
Member

@scmmishra, waiting on a review from me. will take care of this 👍

# Conflicts:
#	Gemfile
#	Gemfile.lock
@netlify
Copy link

netlify bot commented Apr 7, 2023

Deploy Preview for chatwoot-storybook canceled.

Name Link
🔨 Latest commit a108388
🔍 Latest deploy log https://app.netlify.com/sites/chatwoot-storybook/deploys/642fcc427ee8c30008f79125

@sojan-official
Copy link
Member

@making this configurable based on environment variable : LOGRAGE_ENABLED

@sojan-official sojan-official merged commit 71c5a1e into develop Apr 7, 2023
@sojan-official sojan-official deleted the feat/add_lograge branch April 7, 2023 08:14
pranavrajs pushed a commit that referenced this pull request Apr 11, 2023
- Add lograge gem to improve rails logging using `LOGRAGE_ENABLED` env variable
- When enabled Single line log for requests in JSON formatting
- Switch sidekiq also to use JSON formatting

Fixes: chatwoot/product#437
---------

Co-authored-by: Sojan Jose <sojan@pepalo.com>
@github-actions
Copy link

github-actions bot commented May 7, 2023

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants