You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying this library with KServe (see kserve/kserve#2782) and I noticed that headers like User-Agent are not automatically escaped. Could it be a feature to add? For example, if I set something like:
The above leads to valid JSON only if the HTTP headers don't carry extra quotes. I am not sure where the escape would fit best, but added to this library (maybe with a flag?) could be a nice addition. I can work on a PR if the idea is acceptable :)
The text was updated successfully, but these errors were encountered:
@Kludex If you have time I'd need an advice about the best road to take. Ideally having a JSON representation of the Uvicorn access logs would be nice, so I tried multiple roads:
As described above, hacked the format string to print a JSON-like output, but it is not very resilient when we have special chars.
Run uvicorn with a python json logger in its access log logging config (like python-json-logger) but when I override it with asgi-logger I loose also the JSON formatting.
Not sure if you have suggestions about 1), otherwise another solution could be to add a "json" flag to asgi-logger to use a json formatter in AccessLoggerMiddleware. No idea what road is best, I am all ears for suggestions :)
Hi!
I am trying this library with KServe (see kserve/kserve#2782) and I noticed that headers like User-Agent are not automatically escaped. Could it be a feature to add? For example, if I set something like:
The above leads to valid JSON only if the HTTP headers don't carry extra quotes. I am not sure where the escape would fit best, but added to this library (maybe with a flag?) could be a nice addition. I can work on a PR if the idea is acceptable :)
The text was updated successfully, but these errors were encountered: