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: logging_loki/handlers.py
+4-3Lines changed: 4 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -71,7 +71,8 @@ def __init__(
71
71
props_to_labels: Optional[list[str]] =None,
72
72
level_tag: Optional[str] =const.level_tag,
73
73
logger_tag: Optional[str] =const.logger_tag,
74
-
verify: Union[bool, str] =True
74
+
verify: Union[bool, str] =True,
75
+
replace_timestamp: Optional[bool] =False,
75
76
):
76
77
"""
77
78
Create new Loki logging handler.
@@ -86,10 +87,10 @@ def __init__(
86
87
level_tag: Label name indicating logging level.
87
88
logger_tag: Label name indicating logger name.
88
89
verify: Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use.
89
-
90
+
replace_timestamp: If enabled, the timestamp in the log line will be replaced with `time.time_ns()`. Be careful when using this option with `batching` enabled, as the logs will be sent in batches, and the timestamp will be the time of the batch, not the time of the log.
0 commit comments