Make Axios loggings sync (some http requests are not logged in prod in case of failure)
MODIFY
src/utils/AxiosFactory.ts
src/utils/AxiosFactory.ts
@@ -29,19 +29,19 @@ export default class AxiosFactory {
// Create
axiosInstance = axios.create(instanceConfiguration.axiosConfig);
// Add a Request interceptor
- axiosInstance.interceptors.request.use((request: AxiosRequestConfig) => {
- void Logging.logAxiosRequest(tenantID, request);
+ axiosInstance.interceptors.request.use(async (request: AxiosRequestConfig) => {
+ await Logging.logAxiosRequest(tenantID, request);
return request;
}, async (error: AxiosError) => {
- void Logging.logAxiosError(tenantID, error);
+ await Logging.logAxiosError(tenantID, error);
return Promise.reject(error);
});
// Add a Response interceptor
- axiosInstance.interceptors.response.use((response: AxiosResponse) => {
- void Logging.logAxiosResponse(tenantID, response);
+ axiosInstance.interceptors.response.use(async (response: AxiosResponse) => {
+ await Logging.logAxiosResponse(tenantID, response);
return response;
}, async (error: AxiosError) => {
- void Logging.logAxiosError(tenantID, error);
+ await Logging.logAxiosError(tenantID, error);
return Promise.reject(error);
});
// Add

MODIFY
src/utils/Logging.ts
src/utils/Logging.ts
@@ -482,8 +482,7 @@ export default class Logging {
})
);
} catch (error) {
- // FIXME
- // Error Message: Converting circular structure to JSON
+ // FIXME: Error Message: Converting circular structure to JSON
// Temporary FIX: Utils.cloneObject() removed
await Logging.logSecurityDebug({
tenantID: tenantID,

Make Axios loggings sync (some http requests are not logged in prod in case of failure)