Python Forum
Asynchronous Logging in python 2.7
Thread Rating:
  • 3 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Asynchronous Logging in python 2.7
#1
Hi,

I'm new to python. I need help with asynchronous logging implementation

We are doing a lot of logging in our code and we have found that a lot of time is spent on this i/o activity

we would like to log on a different thread from the main thread.

Is there a sample implementation of async logging we can study

Regards all
Reply
#2
Could you share a small snippet of how you're logging?
Do you open/close the file on every log event? Do you log everything to a single place, or do you have multiple logs (ie: error.log, warnings.log, info.log)? Do you rotate your logs?
Reply
#3
just simple stream logging to the console logging.

import logging
logging.info
logging.warn
logging.error etc.

in places where we want to log info or in error/exception catch blocks.
We just want to do all our logging asynchronously.
Reply
#4
Can look at Logbook which has Queue Support.

If you had used Python 3.2 or newer there where added QueueHandler in logging.handlers module.

Look at what there doing with sentry/getsentry(raven) has the most advance logging system out there.
The have also gotten Armin Ronacher in team so the Python part should be good.
Reply
#5
Thanks
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python logging RotatingFileHandler writes to random file after the first log rotation rawatg 0 395 Feb-15-2024, 11:15 AM
Last Post: rawatg
  Python logging error Mekala 2 1,935 Jun-25-2020, 04:03 AM
Last Post: Mekala
  Python Logging and Handling phillyfa 2 4,570 Mar-20-2020, 05:13 PM
Last Post: phillyfa
  Python logging RotatingFileHandler and TimedRotatingFileHandler is not working with Q waytosatyam7 2 4,785 Dec-24-2019, 08:44 AM
Last Post: buran
  How to add asynchronous tasks as they are needed? AlekseyPython 2 3,987 Jan-11-2019, 02:58 AM
Last Post: AlekseyPython
  Logging in python saisankalpj 1 2,416 Nov-12-2018, 05:00 PM
Last Post: ichabod801
  Error while Logging on to outlook email account using Python inside VDI Shilton 0 4,299 Sep-09-2018, 06:53 AM
Last Post: Shilton

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020