Questions tagged [structlog]

Use the structlog tag for the Python package structlog, which provides structured logging for Python applications.

Structured Logging for Python

54 questions
0
votes
1 answer

Change logging level for all Connexion loggers at once

Is there a way to stop or reduce logging? You can either limit all application logging to certain level (DEBUG, INFO, WARNING, ...) - that's to broad and not suitable limit concrete connexion loggers (ie. connexion.operations.abstract) to certein…
Michal Vašut
  • 187
  • 2
  • 8
0
votes
1 answer

Hide console using structlog

Can structlog be used with pythonw to only log in file ? Importing structlog fails when pythonw is used to run the python code because sys.stdout is None. The error is raised in file structlog/_config.py when sys.stdout.isatty() is called. Here is…
0
votes
1 answer

How to hide Celery task id from structlog?

I used Structlog and Celery in my Django application and both work very well, but I would like to prevent task_id from appearing in the log when the worker executes tasks. How can I do that? The reason is that task_id is a key:value of 36 characters…
Florent
  • 1,791
  • 22
  • 40
0
votes
2 answers

Why is python structlog logging a redactError every time I add a list as a key word arg?

I'm using python structlog version 19.1.0 (https://www.structlog.org/en/19.1.0/index.html) and in a previous deployment, I used this same version and did not get any redactError messages in my logs. But now, whenever I add key-word args to a log…
0
votes
1 answer

How to unsort key:value pairs with structlog in plain console mode?

I use structlog with Django and noticed that key:value pairs output is alphabetical in console mode, which means that when I bind a new key beginning with _ like log.bind('_id'=id) then it is added at the very first. I'm asking this question…
Florent
  • 1,791
  • 22
  • 40
0
votes
1 answer

How to redirect logger django_structlog.middlewares.request to another file?

I use structlog with Django but I found my flat_line.log file difficult to read because every time an action is performed in the admin section there are several new entries like these: timestamp='2020-04-23T15:17:49.196600Z' level='info'…
Florent
  • 1,791
  • 22
  • 40
0
votes
1 answer

How do I make Python Structlog to log without the keyword `event`

I am using Python Structlog. Everything is logged as event='Something Happened' I don't want that event keyword and I just want the event data to be logged: 'Something happened' How do I achieve this?
avi
  • 9,292
  • 11
  • 47
  • 84
-1
votes
1 answer

python structlog - can i change log level dynamically but only for specific classes?

my scenario is this - im using a simple logger, and have alot of log.info()/log.debug() messages in my code. i would like to change the log level dynamically, mainly being able to "turn on/off" debug level logs. my question is this - is it somehow…
-1
votes
2 answers

Unable to control structlog using logging

I'm unable to disable logging which is by default turned on via structlog Here's my code below: Input file contain: 5418531366 5418531367 import asyncio import pathlib import sys from arsenic import get_session, errors from arsenic.browsers import…
1 2 3
4