@@ -26,7 +26,8 @@ import logging_loki
2626handler = logging_loki.LokiHandler(
2727 url = " https://my-loki-instance/loki/api/v1/push" ,
2828 tags = {" application" : " my-app" },
29- auth = (" username" , " password" ),
29+ auth = (" username" , " password" ),
30+ version = " 1" ,
3031)
3132
3233logger = logging.getLogger(" my-logger" )
@@ -49,15 +50,16 @@ But you can use the built-in `QueueHandler` and` QueueListener` to send messages
4950``` python
5051import logging.handlers
5152import logging_loki
52- from queue import Queue
53+ from multiprocessing import Queue
5354
5455
5556queue = Queue(- 1 )
5657handler = logging.handlers.QueueHandler(queue)
5758handler_loki = logging_loki.LokiHandler(
5859 url = " https://my-loki-instance/loki/api/v1/push" ,
5960 tags = {" application" : " my-app" },
60- auth = (" username" , " password" ),
61+ auth = (" username" , " password" ),
62+ version = " 1" ,
6163)
6264logging.handlers.QueueListener(queue, handler_loki)
6365
@@ -71,14 +73,15 @@ Or you can use `LokiQueueHandler` shortcut, which will automatically create list
7173``` python
7274import logging.handlers
7375import logging_loki
74- from queue import Queue
76+ from multiprocessing import Queue
7577
7678
7779handler = logging_loki.LokiQueueHandler(
7880 Queue(- 1 ),
7981 url = " https://my-loki-instance/loki/api/v1/push" ,
8082 tags = {" application" : " my-app" },
8183 auth = (" username" , " password" ),
84+ version = " 1" ,
8285)
8386
8487logger = logging.getLogger(" my-logger" )
0 commit comments