I was building some code to do a "Create Database if not exists" and the tracing is a little messy there, even if you do it right. I was properly checking the response status code for 409 and considering that "success". However, if I enable info level tracing for my entire application (including the Cosmos DB SDK, because of how RUST_LOG is inherited down), I get ERROR logs because we get non-200s back from the service.
We should consider either:
- Not logging errors for response status codes at all, just log
DEBUG level.
- Log errors only for
500-class errors.
My leaning here is option 1, since I actually don't think we should be logging errors unless there are true error situations and we just can't know 100% for sure how an app wants to treat individual HTTP errors.
I was building some code to do a "Create Database if not exists" and the tracing is a little messy there, even if you do it right. I was properly checking the response status code for 409 and considering that "success". However, if I enable
infolevel tracing for my entire application (including the Cosmos DB SDK, because of howRUST_LOGis inherited down), I getERRORlogs because we get non-200s back from the service.We should consider either:
DEBUGlevel.500-class errors.My leaning here is option 1, since I actually don't think we should be logging errors unless there are true error situations and we just can't know 100% for sure how an app wants to treat individual HTTP errors.