mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge pull request #1967 from gradido/log-response-as-trace
fix: `.env` log level for apollo and backend category
This commit is contained in:
commit
7b66ba4064
@ -5,7 +5,8 @@ import { readFileSync } from 'fs'
|
||||
|
||||
const options = JSON.parse(readFileSync(CONFIG.LOG4JS_CONFIG, 'utf-8'))
|
||||
|
||||
options.categories.default.level = CONFIG.LOG_LEVEL
|
||||
options.categories.backend.level = CONFIG.LOG_LEVEL
|
||||
options.categories.apollo.level = CONFIG.LOG_LEVEL
|
||||
|
||||
log4js.configure(options)
|
||||
|
||||
|
||||
@ -37,9 +37,11 @@ ${mutation || query}variables: ${JSON.stringify(filterVariables(variables), null
|
||||
return {
|
||||
willSendResponse(requestContext: any) {
|
||||
if (requestContext.context.user) logger.info(`User ID: ${requestContext.context.user.id}`)
|
||||
if (requestContext.response.data)
|
||||
logger.info(`Response-Data:
|
||||
if (requestContext.response.data) {
|
||||
logger.info('Response Success!')
|
||||
logger.trace(`Response-Data:
|
||||
${JSON.stringify(requestContext.response.data, null, 2)}`)
|
||||
}
|
||||
if (requestContext.response.errors)
|
||||
logger.error(`Response-Errors:
|
||||
${JSON.stringify(requestContext.response.errors, null, 2)}`)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user