|
| 1 | +import type { LogAttributes, LogLevel } from '..'; |
| 2 | + |
| 3 | +type PowertoolsLog = LogAttributes & { |
| 4 | + /** |
| 5 | + * timestamp |
| 6 | + * |
| 7 | + * Description: Timestamp of actual log statement. |
| 8 | + * Example: "2020-05-24 18:17:33,774" |
| 9 | + */ |
| 10 | + timestamp?: string; |
| 11 | + |
| 12 | + /** |
| 13 | + * level |
| 14 | + * |
| 15 | + * Description: Logging level |
| 16 | + * Example: "INFO" |
| 17 | + */ |
| 18 | + level?: LogLevel; |
| 19 | + |
| 20 | + /** |
| 21 | + * service |
| 22 | + * |
| 23 | + * Description: Service name defined. |
| 24 | + * Example: "payment" |
| 25 | + */ |
| 26 | + service: string; |
| 27 | + |
| 28 | + /** |
| 29 | + * sampling_rate |
| 30 | + * |
| 31 | + * Description: The value of the logging sampling rate in percentage. |
| 32 | + * Example: 0.1 |
| 33 | + */ |
| 34 | + sampling_rate?: number; |
| 35 | + |
| 36 | + /** |
| 37 | + * message |
| 38 | + * |
| 39 | + * Description: Log statement value. Unserializable JSON values will be cast to string. |
| 40 | + * Example: "Collecting payment" |
| 41 | + */ |
| 42 | + message?: string; |
| 43 | + |
| 44 | + /** |
| 45 | + * xray_trace_id |
| 46 | + * |
| 47 | + * Description: X-Ray Trace ID when Lambda function has enabled Tracing. |
| 48 | + * Example: "1-5759e988-bd862e3fe1be46a994272793" |
| 49 | + */ |
| 50 | + xray_trace_id?: string; |
| 51 | + |
| 52 | + /** |
| 53 | + * cold_start |
| 54 | + * |
| 55 | + * Description: Indicates whether the current execution experienced a cold start. |
| 56 | + * Example: false |
| 57 | + */ |
| 58 | + cold_start?: boolean; |
| 59 | + |
| 60 | + /** |
| 61 | + * lambda_function_name |
| 62 | + * |
| 63 | + * Description: The name of the Lambda function. |
| 64 | + * Example: "example-powertools-HelloWorldFunction-1P1Z6B39FLU73" |
| 65 | + */ |
| 66 | + lambda_function_name?: string; |
| 67 | + |
| 68 | + /** |
| 69 | + * lambda_function_memory_size |
| 70 | + * |
| 71 | + * Description: The memory size of the Lambda function. |
| 72 | + * Example: 128 |
| 73 | + */ |
| 74 | + lambda_function_memory_size?: number; |
| 75 | + |
| 76 | + /** |
| 77 | + * lambda_function_arn |
| 78 | + * |
| 79 | + * Description: The ARN of the Lambda function. |
| 80 | + * Example: "arn:aws:lambda:eu-west-1:012345678910:function:example-powertools-HelloWorldFunction-1P1Z6B39FLU73" |
| 81 | + */ |
| 82 | + lambda_function_arn?: string; |
| 83 | + |
| 84 | + /** |
| 85 | + * lambda_request_id |
| 86 | + * |
| 87 | + * Description: The request ID of the current invocation. |
| 88 | + * Example: "899856cb-83d1-40d7-8611-9e78f15f32f4" |
| 89 | + */ |
| 90 | + lambda_request_id?: string; |
| 91 | +}; |
| 92 | + |
| 93 | +export type { PowertoolsLog }; |
0 commit comments