sls-helper-plugin-janis
Version:
A Serverless Helper plugin to add custom helpers for Janis Commerce
44 lines (40 loc) • 1.49 kB
JavaScript
;
// Variables documentation: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-variables-for-access-logging.html
module.exports.LOG_FORMAT = {
date: '$context.requestTime',
reqId: '$context.requestId',
integReqId: '$context.integration.requestId',
accountId: '$context.accountId',
stage: '$context.stage',
ip: '$context.identity.sourceIp',
ua: '$context.identity.userAgent',
reqMethod: '$context.httpMethod',
path: '$context.resourcePath',
realPath: '$context.path',
status: '$context.status',
authTime: '$context.authorizer.latency',
authStatus: '$context.authorizer.status',
authReqId: '$context.authorizer.requestId',
// Start of Authorizer custom context
clientCode: '$context.authorizer.clientCode',
principalId: '$context.authorizer.principalId',
sessionId: '$context.authorizer.sessionId',
appClientId: '$context.authorizer.appClientId',
authName: '$context.authorizer.authName',
authMethod: '$context.authorizer.authMethod',
apiKey: '$context.authorizer.janisApiKey',
// End of Authorizer custom context
resTime: '$context.responseLatency',
gwError: '$context.error.message',
integError: '$context.integration.error',
integStatus: '$context.integrationStatus',
integLatency: '$context.integrationLatency',
traceId: '$context.xrayTraceId',
wafCode: '$context.wafResponseCode'
};
module.exports.LOG_REST_API_CONFIG = {
accessLogging: true,
executionLogging: false,
level: 'INFO',
fullExecutionData: false
};