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

Make sure all logs in production has JSON format #4694

Merged
merged 5 commits into from
Nov 21, 2024

Conversation

tomas-stefano
Copy link
Contributor

@tomas-stefano tomas-stefano commented Nov 18, 2024

Context

Our logs are not well formatted in Logit.

Changes proposed in this pull request

Make sure logs has the JSON format.

Know issue

There is an issue with some of the logs when requests kicked in:

14:11:53 web.1    | - -> /ping

This is because of WEBrick logs. Soon we will be replacing WEBrick so I didn't solve this particular issue.

Guidance to review

  1. Does it log in JSON in the web app?
  2. Does it log in JSON in the worker app?

@tomas-stefano tomas-stefano added the deploy A Review App will be created for PRs with this label label Nov 18, 2024
config/application.rb Outdated Show resolved Hide resolved
@tomas-stefano tomas-stefano force-pushed the td/9-fix-logs-in-logit-for-publish branch from f392005 to 0fe3fe4 Compare November 18, 2024 15:02
Application name is blank so is an useless configuration
@tomas-stefano tomas-stefano force-pushed the td/9-fix-logs-in-logit-for-publish branch from 788be72 to ae5315c Compare November 18, 2024 15:22
In order to apply the JSON formatter this custom log needs to go.

For the looks of it it is not doing anything that the normal
log and filtering should do.
@tomas-stefano tomas-stefano force-pushed the td/9-fix-logs-in-logit-for-publish branch from 93d12fa to 6e048f3 Compare November 18, 2024 16:08
@tomas-stefano tomas-stefano marked this pull request as ready for review November 20, 2024 15:39
@tomas-stefano tomas-stefano requested a review from a team as a code owner November 20, 2024 15:39
@tomas-stefano
Copy link
Contributor Author


unless Rails.env.local?
Rails.application.configure do
config.semantic_logger.application = Settings.application_name
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this line because Settings.application_name is nil in all environments.

@tomas-stefano tomas-stefano merged commit a1673a5 into main Nov 21, 2024
19 checks passed
@tomas-stefano tomas-stefano deleted the td/9-fix-logs-in-logit-for-publish branch November 21, 2024 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy A Review App will be created for PRs with this label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants