The Wayback Machine - https://web.archive.org/web/20201209020916/https://github.com/ThreeMammals/Ocelot/issues/492
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

How to log error/exception from other services #492

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

How to log error/exception from other services #492

tungphuong opened this issue Jul 24, 2018 · 3 comments

Comments

@tungphuong
Copy link

@tungphuong 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

@TomPallister TomPallister commented Jul 25, 2018

@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
Copy link
Member

@TomPallister TomPallister commented Jul 25, 2018

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

@tungphuong tungphuong commented Jul 25, 2018

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

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 <totubamowo@deloitte.co.uk>

* 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. <44668623+totubamowo@users.noreply.github.com>
Co-authored-by: Catcher Wong <catcher_hwq@outlook.com>
Co-authored-by: jlukawska <56401969+jlukawska@users.noreply.github.com>
Co-authored-by: buretjph <58700930+buretjph@users.noreply.github.com>
Co-authored-by: Jonathan Mezach <jonathanmezach@gmail.com>
Co-authored-by: 彭伟 <pengweiqhca@sina.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.