Access Log
We use tslog for logging, although it has reasonable default settings, but you can still use project config (default is vulcan.yaml) to change some settings to suit your own needs.
like so:
access-log:
enabled: true
options:
level: info
displayRequestId: true
displayFunctionName: true
displayFilePath: hideNodeModulesOnly
Then the access-log output will be as follows:
2022-09-26 08:04:08.307 INFO [ACCESS_LOG packages/serve/src/lib/middleware/accessLogMiddleware.ts:23 AccessLogMiddleware.<anonymous>] --> ::1 -- "GET /api/artist/1" -- size: none
2022-09-26 08:04:08.308 INFO [ACCESS_LOG packages/serve/src/lib/middleware/accessLogMiddleware.ts:26 AccessLogMiddleware.<anonymous>] -> header: {"xxxxxxxxxxxx"}
2022-09-26 08:04:08.308 INFO [ACCESS_LOG packages/serve/src/lib/middleware/accessLogMiddleware.ts:27 AccessLogMiddleware.<anonymous>] -> query: {}
2022-09-26 08:04:08.310 INFO [ACCESS_LOG packages/serve/src/lib/middleware/accessLogMiddleware.ts:28 AccessLogMiddleware.<anonymous>] -> params: undefined
settings
enabled
default: truetype: boolean- Whether to enable the
access-logservice, you can set it tofalseto stopaccess-logservice.
options
We support the level, displayRequestId, displayFunctionName and displayFilePath
options in tslog.
level
default: debugtype: string- must be eithersilly,trace,debug,info,warn,errororfatal.- For more detailed settings and instructions, you can refer to here.
displayRequestId
default: falsetype: boolean- For more detailed settings and instructions, you can refer to here.
displayFunctionName
default: falsetype: boolean- For more detailed settings and instructions, you can refer to here.
displayFilePath
default: hiddentype: string- must be eitherhidden,displayAllorhideNodeModulesOnly.- For more detailed settings and instructions, you can refer to here.