You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/core/logger.md
+7-4
Original file line number
Diff line number
Diff line change
@@ -767,16 +767,19 @@ sequenceDiagram
767
767
4.**What happens if the log buffer reaches its maximum size?**
768
768
Older logs are removed from the buffer to make room for new logs. This means that if the buffer is full, you may lose some logs if they are not flushed before the buffer reaches its maximum size. When this happens, we emit a warning when flushing the buffer to indicate that some logs have been dropped.
769
769
770
-
5.**What timestamp is used when I flush the logs?**
770
+
5.**How is the log size of a log line calculated?**
771
+
The log size is calculated based on the size of the stringified log line in bytes. This includes the size of the log message, the size of any additional keys, and the size of the timestamp.
772
+
773
+
6.**What timestamp is used when I flush the logs?**
771
774
The timestamp preserves the original time when the log record was created. If you create a log record at 11:00:10 and flush it at 11:00:25, the log line will retain its original timestamp of 11:00:10.
772
775
773
-
6.**What happens if I try to add a log line that is bigger than max buffer size?**
776
+
7.**What happens if I try to add a log line that is bigger than max buffer size?**
774
777
The log will be emitted directly to standard output and not buffered. When this happens, we emit a warning to indicate that the log line was too big to be buffered.
775
778
776
-
7.**What happens if Lambda times out without flushing the buffer?**
779
+
8.**What happens if Lambda times out without flushing the buffer?**
777
780
Logs that are still in the buffer will be lost. If you are using the log buffer to log asynchronously, you should ensure that the buffer is flushed before the Lambda function times out. You can do this by calling the `logger.flushBuffer()` method at the end of your Lambda function.
778
781
779
-
8.**Do child loggers inherit the buffer?**
782
+
9.**Do child loggers inherit the buffer?**
780
783
No, child loggers do not inherit the buffer from their parent logger but only the buffer configuration. This means that if you create a child logger, it will have its own buffer and will not share the buffer with the parent logger.
0 commit comments