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

Improve logger to show failed requests URL and when retry will happen #127

Merged
merged 3 commits into from
Sep 23, 2020

Conversation

ArturT
Copy link
Member

@ArturT ArturT commented Sep 23, 2020

  • Improve logger to show failed requests URL
  • More clear message when showing info about waiting for next request retry

Example output:

W, [2020-09-23T13:04:03.675239 #52494]  WARN -- : [knapsack_pro] POST http://api-fake.knapsackpro.test:3000/v1/queues/queue
W, [2020-09-23T13:04:03.675327 #52494]  WARN -- : [knapsack_pro] Request failed due to:
W, [2020-09-23T13:04:03.675354 #52494]  WARN -- : [knapsack_pro] #<SocketError: Failed to open TCP connection to api-fake.knapsackpro.test:3000 (getaddrinfo: nodename nor servname provided, or not known)>
W, [2020-09-23T13:04:03.675392 #52494]  WARN -- : [knapsack_pro] Wait for 8s before retrying the request to Knapsack Pro API.
W, [2020-09-23T13:04:05.678955 #52494]  WARN -- : [knapsack_pro] 6s left before retry...
W, [2020-09-23T13:04:07.683879 #52494]  WARN -- : [knapsack_pro] 4s left before retry...
W, [2020-09-23T13:04:09.689065 #52494]  WARN -- : [knapsack_pro] 2s left before retry...
W, [2020-09-23T13:04:11.697194 #52494]  WARN -- : [knapsack_pro] POST http://api-fake.knapsackpro.test:3000/v1/queues/queue
W, [2020-09-23T13:04:11.697262 #52494]  WARN -- : [knapsack_pro] Request failed due to:
W, [2020-09-23T13:04:11.697296 #52494]  WARN -- : [knapsack_pro] #<SocketError: Failed to open TCP connection to api-fake.knapsackpro.test:3000 (getaddrinfo: nodename nor servname provided, or not known)>
W, [2020-09-23T13:04:11.697338 #52494]  WARN -- : [knapsack_pro] Wait for 16s before retrying the request to Knapsack Pro API.
W, [2020-09-23T13:04:13.701011 #52494]  WARN -- : [knapsack_pro] 14s left before retry...
W, [2020-09-23T13:04:15.706214 #52494]  WARN -- : [knapsack_pro] 12s left before retry...
W, [2020-09-23T13:04:17.711670 #52494]  WARN -- : [knapsack_pro] 10s left before retry...
W, [2020-09-23T13:04:19.714524 #52494]  WARN -- : [knapsack_pro] 8s left before retry...
W, [2020-09-23T13:04:21.716759 #52494]  WARN -- : [knapsack_pro] 6s left before retry...
W, [2020-09-23T13:04:23.718025 #52494]  WARN -- : [knapsack_pro] 4s left before retry...
W, [2020-09-23T13:04:25.722577 #52494]  WARN -- : [knapsack_pro] 2s left before retry...
W, [2020-09-23T13:04:27.735953 #52494]  WARN -- : [knapsack_pro] POST http://api-fake.knapsackpro.test:3000/v1/queues/queue
W, [2020-09-23T13:04:27.736063 #52494]  WARN -- : [knapsack_pro] Request failed due to:
W, [2020-09-23T13:04:27.736125 #52494]  WARN -- : [knapsack_pro] #<SocketError: Failed to open TCP connection to api-fake.knapsackpro.test:3000 (getaddrinfo: nodename nor servname provided, or not known)>

@ArturT ArturT merged commit 25e951a into master Sep 23, 2020
@ArturT ArturT deleted the improve-logger-for-failed-requsts branch September 23, 2020 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant