azure-sdk-for-cpp icon indicating copy to clipboard operation
azure-sdk-for-cpp copied to clipboard

How to get more context info from a logger output?

Open yxiang92128 opened this issue 2 years ago • 4 comments

Query/Question How to get more context info from a logger output?

How do I get timestamp and session id printed in the listener output?

Why is this not a Bug or a feature Request? In the legacy SDK, via boost logger, I can get detailed log entry with timestamp and session id such as the following: **2022-07-28 15:53:14 0433481E-1E0E-460C-8AA3-855F363E4C6D** : Retry policy did not allow for a retry, so throwing exception: The account being accessed does not support http.

but in track2, after SetListener, the message captured in the listener only has the error message itself, for instance, HTTP Transport error: Fail to get a new connection for: ://. URL using bad/illegal format or missing URL

there is NO timestamp and there is NO unique session id which could help in debugging multiple interleaved requests.

Setup (please complete the following information if applicable):

  • OS: SLES15SP4
  • IDE : [e.g. IntelliJ]: n/a
  • Version of the Library used: the latest head

Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • [ ] Query Added
  • [ ] Setup information Added

yxiang92128 avatar Aug 09 '22 18:08 yxiang92128

Does anybody have insight into this? The current log messages are just hard to follow especially if I have multiple operation going on in the same process. And it does not provide much details on REST exchanges as before in track1 SDK.

yxiang92128 avatar Aug 12 '22 16:08 yxiang92128

@RickWinter Can you find somebody to answer this question? Thanks

Jinming-Hu avatar Aug 22 '22 04:08 Jinming-Hu

Hi @RickWinter , can you take a look at this issue? It's been open for a month. Thanks

Jinming-Hu avatar Sep 08 '22 03:09 Jinming-Hu

Any update on this issue? Can you add an additional parameter to the "SetListener" to pass in user specified info so we can at least put out our own session info in the log output? Currently as it stands, the log messages generated can't be told apart.

Thanks,

Yang

yxiang92128 avatar Sep 12 '22 21:09 yxiang92128