2

I sent my logger information into 'seq' module. I have:

_log_format = f"%(asctime)s - [%(levelname)s] - request_id=%(request_id)s - %(name)s - (%(filename)s).%(funcName)s(%(lineno)d) - %(message)s"
logger.info("Hello, {name}", name="world")

As result in 'seq' I have only:

'

No one from: f"%(asctime)s - [%(levelname)s] - request_id=%(request_id)s - %(name)s - (%(filename)s).%(funcName)s(%(lineno)d) - %(message)s" was add into 'seq'.

In stream is all right:

2021-08-20 14:40:24,244 - [INFO] - request_id=None - app - (__init__.py).create_app(43) - Hello, world

I sent logs to 'seq' by this way:

import seqlog

seqlog.log_to_seq(
   server_url="http://localhost:5341/",
   api_key="My API Key",
   level=logging.INFO,
   batch_size=10,
   auto_flush_timeout=10,  # seconds
   override_root_logger=True,
)
mkrieger1
  • 19,194
  • 5
  • 54
  • 65
SergeyS
  • 59
  • 3
  • What did you do with the local string variable `_log_format`? How did you pass it to "seq"? – mkrieger1 Aug 20 '21 at 11:58
  • Standart way: `stream_handler.setFormatter(logging.Formatter(_log_format))` – SergeyS Aug 20 '21 at 12:08
  • to 'seq': `import seqlog seqlog.log_to_seq( server_url="http://localhost:5341/", api_key="My API Key", level=logging.INFO, batch_size=10, auto_flush_timeout=10, # seconds override_root_logger=True, )` – SergeyS Aug 20 '21 at 12:09

0 Answers0