diff --git a/packages/ripple-nuxt-tide/lib/server-middleware/request-log.js b/packages/ripple-nuxt-tide/lib/server-middleware/request-log.js index 88d62162b..61ca24098 100644 --- a/packages/ripple-nuxt-tide/lib/server-middleware/request-log.js +++ b/packages/ripple-nuxt-tide/lib/server-middleware/request-log.js @@ -9,7 +9,7 @@ module.exports = function (req, res, next) { const reqUrl = url.parse(req.url) const reqPath = decodeURI(reqUrl.pathname) if (reqPath.includes('/api/v')) { - logger.info('Proxy %s %s to backend, res status code: %s.', method, reqPath, status, { label: 'Connect', requestQuery: reqUrl.query, requestId: req.headers['x-request-id'] }) + logger.info('Proxy %s request to %s, res status code: %s.', method, process.env.CONTENT_API_SERVER + reqPath, status, { label: 'Connect', requestQuery: reqUrl.query, requestId: req.headers['x-request-id'] }) } else { logger.info('Server got request: %s %s %s', status, method, reqPath, { label: 'Connect', requestQuery: reqUrl.query, requestId: req.requestId }) } diff --git a/packages/ripple-nuxt-tide/lib/templates/axios.js b/packages/ripple-nuxt-tide/lib/templates/axios.js index 729c557b1..0ca9b99cc 100644 --- a/packages/ripple-nuxt-tide/lib/templates/axios.js +++ b/packages/ripple-nuxt-tide/lib/templates/axios.js @@ -5,7 +5,9 @@ export default function ({ $axios, app, res }) { $axios.onRequest(config => { // Log all axios' requests if (process.server) { - logger.info('Making %s request to %s', config.method.toUpperCase(), config.url, {label: 'Axios', requestId: config.headers['X-Request-Id']}) + const baseURL = config.baseURL.length > 1 ? config.baseURL.substring(0, config.baseURL.length - 1) : '' + const fullUrl = baseURL + config.url + logger.info('Making %s request to %s', config.method.toUpperCase(), fullUrl, {label: 'Axios', requestId: config.headers['X-Request-Id']}) logger.debug('Headers %O', config.headers, {label: 'Axios'}) } })