fix(api-gateway): debug log on error thrown body representation
This commit is contained in:
parent
3fa01a328b
commit
c8bf4ab3a0
1 changed files with 5 additions and 1 deletions
|
@ -92,7 +92,11 @@ void container.load().then((container) => {
|
||||||
server.setErrorConfig((app) => {
|
server.setErrorConfig((app) => {
|
||||||
app.use((error: Record<string, unknown>, request: Request, response: Response, _next: NextFunction) => {
|
app.use((error: Record<string, unknown>, request: Request, response: Response, _next: NextFunction) => {
|
||||||
logger.error(`[URL: ${request.url}][SNJS: ${request.headers['x-snjs-version']}] Error thrown: ${error.stack}`)
|
logger.error(`[URL: ${request.url}][SNJS: ${request.headers['x-snjs-version']}] Error thrown: ${error.stack}`)
|
||||||
logger.debug(`[URL: ${request.url}][SNJS: ${request.headers['x-snjs-version']}] Request body: ${request.body}`)
|
logger.debug(
|
||||||
|
`[URL: ${request.url}][SNJS: ${request.headers['x-snjs-version']}] Request body: ${JSON.stringify(
|
||||||
|
request.body,
|
||||||
|
)}`,
|
||||||
|
)
|
||||||
|
|
||||||
response.status(500).send({
|
response.status(500).send({
|
||||||
error: {
|
error: {
|
||||||
|
|
Loading…
Reference in a new issue