Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

How to log 500 error/exception from other services? #492

Closed
tungphuong opened this issue Jul 24, 2018 · 3 comments
Closed

How to log 500 error/exception from other services? #492

tungphuong opened this issue Jul 24, 2018 · 3 comments
Assignees
Labels
feature A new feature good first issue Should be pretty easy to do help wanted Not actively being worked on. If you plan to contribute, please drop a note. question Initially seen a question could become a new feature or bug or closed ;) small effort Likely less than a day of development effort.

Comments

@tungphuong
Copy link

tungphuong commented Jul 24, 2018

Hello,

I have just used it. It works well but I have one concern that how to log exception (Http code 500) from downstream services. Currently, if I switch log level to "error", I cannot receive anything. However, if log level is "trace", there is some below info

trce: Ocelot.Logging.OcelotDiagnosticListener[0]
      => RequestId:0HLFHAF0APTOQ:00000002 RequestPath:/api/r/xxx/countries => RequestId:0HLFHAF0APTOQ:00000002 RequestPath:/api/r/xxx/countries => RequestId:0HLFHAF0APTOQ:00000002 RequestPath:/api/r/xxx/countries
      requestId: 0HLFHAF0APTOQ:00000002, previousRequestId: no previous request id, message: MiddlewareFinished: Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware; 500
: Ocelot.Logging.OcelotDiagnosticListener[0]
      requestId: 0HLFHAF0APTOQ:00000002, previousRequestId: no previous request id, message: MiddlewareFinished: TransitionToOcelotMiddleware; 500

Please let me know if there is any missing.

Thanks,

@TomPallister
Copy link
Member

@tungphuong I will test this and get back to you ASAP! If you want to submit a PR that adds the logging let me know.

@TomPallister TomPallister added the question Initially seen a question could become a new feature or bug or closed ;) label Jul 25, 2018
@TomPallister
Copy link
Member

from other issue

Hi,

Currently, if downstream service throw exception with httpcode 500, but Ocelot just logs "warning" or "debug". It will not clear and difficult to trace/monitor on production. Because we cannot set log level is debug/info for production.

I suggest we should check status code. If it is 500, we wil log like error.\

Cheers,

Phuong Le

@tungphuong
Copy link
Author

Yes, 2 items are the same. Ok, I will submit one PR :)

@TomPallister TomPallister added feature A new feature help wanted Not actively being worked on. If you plan to contribute, please drop a note. good first issue Should be pretty easy to do small effort Likely less than a day of development effort. and removed question Initially seen a question could become a new feature or bug or closed ;) labels Jul 25, 2018
jlukawska added a commit to jlukawska/Ocelot that referenced this issue Nov 7, 2019
jlukawska added a commit to jlukawska/Ocelot that referenced this issue Nov 11, 2019
TomPallister added a commit that referenced this issue Jan 19, 2020
…namic behaviour

* Make rate-limiting client whitelist dynamic
* Refactor `RateLimitOptions.ClientWhiteList`
* Fix typo in variable `enbleRateLimiting`
* Fix case in variable `clientIdheader`
author Taiwo Otubamowo <[email protected]>

* fix 1045

* #492 log 500 with error log level, acceptance test, unit test

* #492 minor changes

* initial commit for new feature #1077

allow to limit the number of concurrent tcp connection to a downstream service

* protect code against value not in accurate range

add unit test

* Do not crash host on Dispose

* Add test

* Pin GitVersion.CommandLine package version

* #683 validate if there are duplicated placeholders in UpstreamPathTemplate

* Use registered scheme from Eureka (#1087)

* extra test

* very brief mention MaxConnectionsPerServer in docs

* build develop like a PR

* more docs

* test

Co-authored-by: Taiwo O. <[email protected]>
Co-authored-by: Catcher Wong <[email protected]>
Co-authored-by: jlukawska <[email protected]>
Co-authored-by: buretjph <[email protected]>
Co-authored-by: Jonathan Mezach <[email protected]>
Co-authored-by: 彭伟 <[email protected]>
@raman-m raman-m changed the title How to log error/exception from other services How to log 500 error/exception from other services? Nov 29, 2023
@raman-m raman-m self-assigned this Nov 29, 2023
@raman-m raman-m added the question Initially seen a question could become a new feature or bug or closed ;) label Nov 29, 2023
@ThreeMammals ThreeMammals locked and limited conversation to collaborators Nov 29, 2023
@raman-m raman-m converted this issue into discussion #1819 Nov 29, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
feature A new feature good first issue Should be pretty easy to do help wanted Not actively being worked on. If you plan to contribute, please drop a note. question Initially seen a question could become a new feature or bug or closed ;) small effort Likely less than a day of development effort.
Projects
None yet
Development

No branches or pull requests

3 participants