Skip to content

Commit d48c1f8

Browse files
authored
Update logger.md (#1048)
1 parent a0f1db2 commit d48c1f8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/core/logger.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ To remove the keys you added, you can use the `removeKeys` method.
294294
```
295295
=== "Example CloudWatch Logs excerpt"
296296

297-
```json hl_lines="8-12 21-25"
297+
```json hl_lines="7-12 20-25"
298298
{
299299
"level": "INFO",
300300
"message": "This is an INFO log",
@@ -497,7 +497,7 @@ You can append additional data to a single log item by passing objects as additi
497497
```
498498
=== "Example CloudWatch Logs excerpt"
499499

500-
```json hl_lines="7 15-21 28 37"
500+
```json hl_lines="7 15-21 29 37"
501501
{
502502
"level": "INFO",
503503
"message": "This is a log with an extra variable",
@@ -508,7 +508,7 @@ You can append additional data to a single log item by passing objects as additi
508508
}
509509
{
510510
"level": "INFO",
511-
"message": "This is a log with 2 extra variables",
511+
"message": "This is a log with 3 extra objects",
512512
"service": "serverlessAirline",
513513
"timestamp": "2021-12-12T22:06:17.466Z",
514514
"xray_trace_id": "abcdef123456abcdef123456abcdef123456",
@@ -574,27 +574,27 @@ The error will be logged with default key name `error`, but you can also pass yo
574574
```json hl_lines="7-12 20-25"
575575
{
576576
"level": "ERROR",
577-
"message": "This is an ERROR log #1",
577+
"message": "This is the first error",
578578
"service": "serverlessAirline",
579579
"timestamp": "2021-12-12T22:12:39.345Z",
580580
"xray_trace_id": "abcdef123456abcdef123456abcdef123456",
581581
"error": {
582582
"name": "Error",
583583
"location": "/path/to/my/source-code/my-service/handler.ts:18",
584-
"message": "This is the first error",
584+
"message": "Unexpected error #1",
585585
"stack": "Error: Unexpected error #1 at lambdaHandler (/path/to/my/source-code/my-service/handler.ts:18:11) at Object.<anonymous> (/path/to/my/source-code/my-service/handler.ts:35:1) at Module._compile (node:internal/modules/cjs/loader:1108:14) at Module.m._compile (/path/to/my/source-code/node_modules/ts-node/src/index.ts:1371:23) at Module._extensions..js (node:internal/modules/cjs/loader:1137:10) at Object.require.extensions.<computed> [as .ts] (/path/to/my/source-code/node_modules/ts-node/src/index.ts:1374:12) at Module.load (node:internal/modules/cjs/loader:973:32) at Function.Module._load (node:internal/modules/cjs/loader:813:14) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12) at main (/path/to/my/source-code/node_modules/ts-node/src/bin.ts:331:12)"
586586
}
587587
}
588588
{
589589
"level": "ERROR",
590-
"message": "This is an ERROR log #2",
590+
"message": "This is the second error",
591591
"service": "serverlessAirline",
592592
"timestamp": "2021-12-12T22:12:39.377Z",
593593
"xray_trace_id": "abcdef123456abcdef123456abcdef123456",
594594
"myCustomErrorKey": {
595595
"name": "Error",
596596
"location": "/path/to/my/source-code/my-service/handler.ts:24",
597-
"message": "This is the second error",
597+
"message": "Unexpected error #2",
598598
"stack": "Error: Unexpected error #2 at lambdaHandler (/path/to/my/source-code/my-service/handler.ts:24:11) at Object.<anonymous> (/path/to/my/source-code/my-service/handler.ts:35:1) at Module._compile (node:internal/modules/cjs/loader:1108:14) at Module.m._compile (/path/to/my/source-code/node_modules/ts-node/src/index.ts:1371:23) at Module._extensions..js (node:internal/modules/cjs/loader:1137:10) at Object.require.extensions.<computed> [as .ts] (/path/to/my/source-code/node_modules/ts-node/src/index.ts:1374:12) at Module.load (node:internal/modules/cjs/loader:973:32) at Function.Module._load (node:internal/modules/cjs/loader:813:14) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12) at main (/path/to/my/source-code/node_modules/ts-node/src/bin.ts:331:12)"
599599
}
600600
}

0 commit comments

Comments
 (0)