-
Notifications
You must be signed in to change notification settings - Fork 33
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
Buffer in logs #69
Labels
enhancement
New feature or request
Comments
I need for option! I will consider. |
One solution to solving this problem is to leverage the mixin loggers. Sample code below for how I achieved a similar result: axiosInstance.interceptors.request.use((request) => {
request.headers['Authorization'] = '<REDACTED>';
request.headers.buffer = request.headers.buffer ? '<REDACTED>' : undefined;
return AxiosLogger.requestLogger(request);
}, AxiosLogger.errorLogger); This will update the headers generated on a request object and replace with the string
|
Hi! I had the same issue, the next piece of code resolves it: axiosInstance.interceptors.response.use(
(response) =>
responseLogger(response, {
data: response.config.responseType !== 'arraybuffer', // Don't log response body for binary responses
}),
errorLogger
) |
@cernadasjuan Thank you for report! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It is always frustrating when request/response contains a buffer. Dumping in console as is totally useless because of huge amount of data inside and causes a harder debug of other requests.
#55 will help in a certain way. Though it will be nice to have an option to completely exclude buffer data from logging.
Now
Want to
The text was updated successfully, but these errors were encountered: