Catalog PyPI
PACKAGE EXPLORERView in registry

acrilog

PyPI

acrilog is a Python library of providing multiprocessing idiomto us in multiprocessing environment

libraryloggermultiprocessing
Versions collected1
Direct dependencies0From release 2.0.13
Last observed20 Oct, 18:25 UTC

README

Version 2.0.13 documentation
=======
acrilog
=======

----------------------
Multiprocessing logger
----------------------

.. contents:: Table of Contents
   :depth: 2

Overview
========

    **acrilog** is a python library encapsulating multiprocessing logging into practical use.
    
    **acrilog** started as Acrisel's internal utility for programmers.
    
    It included:
        1. Time and size rotating handler.
        #. Multiprocessing logging queue server
        
    The library makes it easier to add logging in a multiprocessing environment where processes are split among multiple Python source codes.  
    
    We decided to contribute this library to Python community as a token of appreciation to
    what this community enables us.
    
    We hope that you will find this library useful and helpful as we find it.
    
    If you have comments or insights, please don't hesitate to contact us at support@acrisel.com
    

TimedSizedRotatingHandler
=========================
	
    Use TimedSizedRotatingHandler is combining TimedRotatingFileHandler with RotatingFileHandler.  
    Usage as handler with logging is as defined in Python's logging how-to
	
example
-------

    .. code-block:: python
	
        import logging
	
        # create logger
        logger = logging.getLogger('simple_example')
        logger.setLevel(logging.DEBUG)
	
        # create console handler and set level to debug
        ch = logging.TimedRotatingFileHandler()
        ch.setLevel(logging.DEBUG)
	
        # create formatter
        formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
	
        # add formatter to ch
        ch.setFormatter(formatter)
	
        # add ch to logger
        logger.addHandler(ch)
	
        # 'application' code
        logger.debug('debug message')
        logger.info('info message')
        logger.warn('warn message')
        logger.error('error message')
        logger.critical('critical message')	

MpLogger and LevelBasedFormatter
================================

    Multiprocessor logger using QueueListener and QueueHandler
    It uses TimedSizedRotatingHandler as its logging handler

    It also uses acris provided LevelBasedFormatter which facilitate message formats
    based on record level.  LevelBasedFormatter inherent from logging.Formatter and
    can be used as such in customized logging handlers. 
	
example
-------

Within main process
~~~~~~~~~~~~~~~~~~~

    .. code-block:: python
	
        import time
        import random
        import logging
        from acris import MpLogger
        import os
        import multiprocessing as mp

        def subproc(limit=1, logger_info=None):
            logger = MpLogger.get_logger(logger_info, name="acrilog.subproc", )
    		for i in range(limit):
                sleep_time = 3/random.randint(1,10)
                time.sleep(sleep_time)
                logger.info("proc [%s]: %s/%s - sleep %4.4ssec" % (os.getpid(), i, limit, sleep_time))

        level_formats = {logging.DEBUG:"[ %(asctime)s ][ %(levelname)s ][ %(message)s ][ %(module)s.%(funcName)s(%(lineno)d) ]",
                        'default':   "[ %(asctime)s ][ %(levelname)s ][ %(message)s ]",
                        }
    
        mplogger = MpLogger(logging_level=logging.DEBUG, level_formats=level_formats, datefmt='%Y-%m-%d,%H:%M:%S.%f')
        mplogger.start(name='main_process')
        logger = MpLogger.get_logger(mplogger.logger_info())

        logger.debug("starting sub processes")
        procs = list()
        for limit in [1, 1]:
            proc = mp.Process(target=subproc, args=(limit, mplogger.logger_info(),))
            procs.append(proc)
            proc.start()
    
        for proc in procs:
            if proc:
                proc.join()
    
        logger.debug("sub processes completed")

        mplogger.stop()	
        
    
Example output
--------------

    .. code-block:: python

        [ 2016-12-19,11:39:44.953189 ][ DEBUG ][ starting sub processes ][ mplogger.<module>(45) ]
        [ 2016-12-19,11:39:45.258794 ][ INFO ][ proc [932]: 0/1 - sleep  0.3sec ]
        [ 2016-12-19,11:39:45.707914 ][ INFO ][ proc [931]: 0/1 - sleep 0.75sec ]
        [ 2016-12-19,11:39:45.710487 ][ DEBUG ][ sub processes completed ][ mplogger.<module>(56) ]
        
Clarification of parameters
===========================

name
----

**name** identifies the base name for logger. Note the this parameter is available in both MpLogger init method and in its start method.

MpLogger init's **name** argument is used for consolidated logger when **consolidate** is set.  It is also used for private logger of the main process, if one not provided when calling *start()* method. 

proecess_key
------------

**process_key** defines one or more logger record field that would be part of the file name of the log.  In case it is used, logger will have a file per records' process key.  This will be in addition for a consolidated log, if **consolidate** is set. 

By default, MpLogger uses **name** as the process key.  If something else is provided, e.g., **processName**, it will be concatenated to **name** as postfix.  

file_prefix and file_suffix
---------------------------

Allows to distinguish among sets of logs of different runs by setting one (or both) of **file_prefix** and **file_suffix**.  Usually, the use of PID and granular datetime as prefix or suffix would create unique set of logs.

file_mode
---------

**file_mode** let program define how logs will be opened.  In default, logs are open in append mode.  Hense, history is collected and file a rolled overnight and by size. 

consolidate
----------- 

**consolidate**, when set, will create consolidated log from all processing logs.
If **consolidated** is set and *start()* is called without **name**, consolidation will be done into the main process.

kwargs
------

**kwargs** are named arguments that will passed to FileHandler.  This include:

    .. code-block::
    
        file_mode='a', for RotatingFileHandler
        maxBytes=0, for RotatingFileHandler
        backupCount=0, for RotatingFileHandler and TimedRotatingFileHandler
        encoding='ascii', for RotatingFileHandler and TimedRotatingFileHandler
        delay=False, for TimedRotatingFileHandler
        when='h', for TimedRotatingFileHandler
        interval=1, TimedRotatingFileHandler
        utc=False, TimedRotatingFileHandler
        atTime=None, for TimedRotatingFileHandler
    
     
Change History
==============

v0.9
----
    
    1. added ability to pass logger_info to subprocess, 
    2. exposed encoding parameter
    
v1.0
----

    1. replaced **force_global** with **consolidate** to genrerate consolidated log
    2. add **name** argument to MpLogger.start().  This will return logger with that name for the main process.
    3. MpLogger.__init__() **name** argument will be used for consolidated log.
    
v1.1
----

    1. add **file_prefix** and **file_suffix** as MpLogger parameters.
    2. fix bug when logdir is None.
    
v2.0
----

    1. added NwLogger starting a server logger with NwLoggerClientHandler for remote processes.
    

Next Steps
==========

    1. Cluster support using TCP/IP 
    #. Logging monitor and alert

Downloads & popularity

4downloads
1-day window · source-reported counts19 Oct 2026
36180
2026-07-23: 1 · observed 2026-10-20T19:45:04.9229482Z · period 2026-07-23–2026-07-232026-07-30: 1 · observed 2026-10-20T19:45:04.9229482Z · period 2026-07-30–2026-07-302026-07-31: 2 · observed 2026-10-20T19:45:04.9229482Z · period 2026-07-31–2026-07-312026-08-01: 2 · observed 2026-10-20T19:45:04.9229482Z · period 2026-08-01–2026-08-012026-08-02: 1 · observed 2026-10-20T19:45:04.9229482Z · period 2026-08-02–2026-08-022026-08-03: 6 · observed 2026-10-20T19:45:04.9229482Z · period 2026-08-03–2026-08-032026-08-04: 3 · observed 2026-10-20T19:45:04.9229482Z · period 2026-08-04–2026-08-042026-08-05: 2 · observed 2026-10-20T19:45:04.9229482Z · period 2026-08-05–2026-08-052026-08-06: 2 · observed 2026-10-20T19:45:04.9229482Z · period 2026-08-06–2026-08-062026-08-07: 1 · observed 2026-10-20T19:45:04.9229482Z · period 2026-08-07–2026-08-072026-08-09: 8 · observed 2026-10-20T19:45:04.9229482Z · period 2026-08-09–2026-08-092026-08-10: 2 · observed 2026-10-20T19:45:04.9229482Z · period 2026-08-10–2026-08-102026-08-12: 1 · observed 2026-10-20T19:45:04.9229482Z · period 2026-08-12–2026-08-122026-08-14: 3 · observed 2026-10-20T19:45:04.9229482Z · period 2026-08-14–2026-08-142026-08-15: 1 · observed 2026-10-20T19:45:04.9229482Z · period 2026-08-15–2026-08-152026-08-17: 4 · observed 2026-10-20T19:45:04.9229482Z · period 2026-08-17–2026-08-172026-08-18: 36 · observed 2026-10-20T19:45:04.9229482Z · period 2026-08-18–2026-08-182026-08-19: 1 · observed 2026-10-20T19:45:04.9229482Z · period 2026-08-19–2026-08-192026-08-20: 3 · observed 2026-10-20T19:45:04.9229482Z · period 2026-08-20–2026-08-202026-08-21: 4 · observed 2026-10-20T19:45:04.9229482Z · period 2026-08-21–2026-08-212026-08-22: 1 · observed 2026-10-20T19:45:04.9229482Z · period 2026-08-22–2026-08-222026-08-23: 1 · observed 2026-10-20T19:45:04.9229482Z · period 2026-08-23–2026-08-232026-08-24: 2 · observed 2026-10-20T19:45:04.9229482Z · period 2026-08-24–2026-08-242026-08-25: 1 · observed 2026-10-20T19:45:04.9229482Z · period 2026-08-25–2026-08-252026-08-27: 15 · observed 2026-10-20T19:45:04.9229482Z · period 2026-08-27–2026-08-272026-08-31: 4 · observed 2026-10-20T19:45:04.9229482Z · period 2026-08-31–2026-08-312026-09-02: 2 · observed 2026-10-20T19:45:04.9229482Z · period 2026-09-02–2026-09-022026-09-03: 1 · observed 2026-10-20T19:45:04.9229482Z · period 2026-09-03–2026-09-032026-09-06: 4 · observed 2026-10-20T19:45:04.9229482Z · period 2026-09-06–2026-09-062026-09-09: 2 · observed 2026-10-20T19:45:04.9229482Z · period 2026-09-09–2026-09-092026-09-10: 1 · observed 2026-10-20T19:45:04.9229482Z · period 2026-09-10–2026-09-102026-09-12: 1 · observed 2026-10-20T19:45:04.9229482Z · period 2026-09-12–2026-09-122026-09-13: 5 · observed 2026-10-20T19:45:04.9229482Z · period 2026-09-13–2026-09-132026-09-14: 1 · observed 2026-10-20T19:45:04.9229482Z · period 2026-09-14–2026-09-142026-09-19: 2 · observed 2026-10-20T19:45:04.9229482Z · period 2026-09-19–2026-09-192026-09-20: 1 · observed 2026-10-20T19:45:04.9229482Z · period 2026-09-20–2026-09-202026-09-24: 8 · observed 2026-10-20T19:45:04.9229482Z · period 2026-09-24–2026-09-242026-09-25: 4 · observed 2026-10-20T19:45:04.9229482Z · period 2026-09-25–2026-09-252026-09-26: 9 · observed 2026-10-20T19:45:04.9229482Z · period 2026-09-26–2026-09-262026-09-27: 2 · observed 2026-10-20T19:45:04.9229482Z · period 2026-09-27–2026-09-272026-09-28: 2 · observed 2026-10-20T19:45:04.9229482Z · period 2026-09-28–2026-09-282026-09-29: 2 · observed 2026-10-20T19:45:04.9229482Z · period 2026-09-29–2026-09-292026-09-30: 6 · observed 2026-10-20T19:45:04.9229482Z · period 2026-09-30–2026-09-302026-10-01: 23 · observed 2026-10-20T19:45:04.9229482Z · period 2026-10-01–2026-10-012026-10-02: 6 · observed 2026-10-20T19:45:04.9229482Z · period 2026-10-02–2026-10-022026-10-03: 4 · observed 2026-10-20T19:45:04.9229482Z · period 2026-10-03–2026-10-032026-10-06: 15 · observed 2026-10-20T19:45:04.9229482Z · period 2026-10-06–2026-10-062026-10-07: 10 · observed 2026-10-20T19:45:04.9229482Z · period 2026-10-07–2026-10-072026-10-08: 16 · observed 2026-10-20T19:45:04.9229482Z · period 2026-10-08–2026-10-082026-10-09: 5 · observed 2026-10-20T19:45:04.9229482Z · period 2026-10-09–2026-10-092026-10-10: 2 · observed 2026-10-20T19:45:04.9229482Z · period 2026-10-10–2026-10-102026-10-11: 9 · observed 2026-10-20T19:45:04.9229482Z · period 2026-10-11–2026-10-112026-10-12: 9 · observed 2026-10-20T19:45:04.9229482Z · period 2026-10-12–2026-10-122026-10-13: 3 · observed 2026-10-20T19:45:04.9229482Z · period 2026-10-13–2026-10-132026-10-14: 2 · observed 2026-10-20T19:45:04.9229482Z · period 2026-10-14–2026-10-142026-10-15: 3 · observed 2026-10-20T19:45:04.9229482Z · period 2026-10-15–2026-10-152026-10-16: 5 · observed 2026-10-20T19:45:04.9229482Z · period 2026-10-16–2026-10-162026-10-17: 3 · observed 2026-10-20T19:45:04.9229482Z · period 2026-10-17–2026-10-172026-10-18: 4 · observed 2026-10-20T19:45:04.9229482Z · period 2026-10-18–2026-10-182026-10-19: 4 · observed 2026-10-20T19:45:04.9229482Z · period 2026-10-19–2026-10-19
23 Jul19 Oct

pypistats · 60 observations shown. Missing days are unknown. Source category: overall: without mirrors.

View observed values
Date / source periodValueObserved at
2026-10-19 – 2026-10-1942026-10-20T19:45:04.9229482Z
2026-10-18 – 2026-10-1842026-10-20T19:45:04.9229482Z
2026-10-17 – 2026-10-1732026-10-20T19:45:04.9229482Z
2026-10-16 – 2026-10-1652026-10-20T19:45:04.9229482Z
2026-10-15 – 2026-10-1532026-10-20T19:45:04.9229482Z
2026-10-14 – 2026-10-1422026-10-20T19:45:04.9229482Z
2026-10-13 – 2026-10-1332026-10-20T19:45:04.9229482Z
2026-10-12 – 2026-10-1292026-10-20T19:45:04.9229482Z
2026-10-11 – 2026-10-1192026-10-20T19:45:04.9229482Z
2026-10-10 – 2026-10-1022026-10-20T19:45:04.9229482Z
2026-10-09 – 2026-10-0952026-10-20T19:45:04.9229482Z
2026-10-08 – 2026-10-08162026-10-20T19:45:04.9229482Z
2026-10-07 – 2026-10-07102026-10-20T19:45:04.9229482Z
2026-10-06 – 2026-10-06152026-10-20T19:45:04.9229482Z
2026-10-03 – 2026-10-0342026-10-20T19:45:04.9229482Z
2026-10-02 – 2026-10-0262026-10-20T19:45:04.9229482Z
2026-10-01 – 2026-10-01232026-10-20T19:45:04.9229482Z
2026-09-30 – 2026-09-3062026-10-20T19:45:04.9229482Z
2026-09-29 – 2026-09-2922026-10-20T19:45:04.9229482Z
2026-09-28 – 2026-09-2822026-10-20T19:45:04.9229482Z
2026-09-27 – 2026-09-2722026-10-20T19:45:04.9229482Z
2026-09-26 – 2026-09-2692026-10-20T19:45:04.9229482Z
2026-09-25 – 2026-09-2542026-10-20T19:45:04.9229482Z
2026-09-24 – 2026-09-2482026-10-20T19:45:04.9229482Z
2026-09-20 – 2026-09-2012026-10-20T19:45:04.9229482Z
2026-09-19 – 2026-09-1922026-10-20T19:45:04.9229482Z
2026-09-14 – 2026-09-1412026-10-20T19:45:04.9229482Z
2026-09-13 – 2026-09-1352026-10-20T19:45:04.9229482Z
2026-09-12 – 2026-09-1212026-10-20T19:45:04.9229482Z
2026-09-10 – 2026-09-1012026-10-20T19:45:04.9229482Z
2026-09-09 – 2026-09-0922026-10-20T19:45:04.9229482Z
2026-09-06 – 2026-09-0642026-10-20T19:45:04.9229482Z
2026-09-03 – 2026-09-0312026-10-20T19:45:04.9229482Z
2026-09-02 – 2026-09-0222026-10-20T19:45:04.9229482Z
2026-08-31 – 2026-08-3142026-10-20T19:45:04.9229482Z
2026-08-27 – 2026-08-27152026-10-20T19:45:04.9229482Z
2026-08-25 – 2026-08-2512026-10-20T19:45:04.9229482Z
2026-08-24 – 2026-08-2422026-10-20T19:45:04.9229482Z
2026-08-23 – 2026-08-2312026-10-20T19:45:04.9229482Z
2026-08-22 – 2026-08-2212026-10-20T19:45:04.9229482Z
2026-08-21 – 2026-08-2142026-10-20T19:45:04.9229482Z
2026-08-20 – 2026-08-2032026-10-20T19:45:04.9229482Z
2026-08-19 – 2026-08-1912026-10-20T19:45:04.9229482Z
2026-08-18 – 2026-08-18362026-10-20T19:45:04.9229482Z
2026-08-17 – 2026-08-1742026-10-20T19:45:04.9229482Z
2026-08-15 – 2026-08-1512026-10-20T19:45:04.9229482Z
2026-08-14 – 2026-08-1432026-10-20T19:45:04.9229482Z
2026-08-12 – 2026-08-1212026-10-20T19:45:04.9229482Z
2026-08-10 – 2026-08-1022026-10-20T19:45:04.9229482Z
2026-08-09 – 2026-08-0982026-10-20T19:45:04.9229482Z
2026-08-07 – 2026-08-0712026-10-20T19:45:04.9229482Z
2026-08-06 – 2026-08-0622026-10-20T19:45:04.9229482Z
2026-08-05 – 2026-08-0522026-10-20T19:45:04.9229482Z
2026-08-04 – 2026-08-0432026-10-20T19:45:04.9229482Z
2026-08-03 – 2026-08-0362026-10-20T19:45:04.9229482Z
2026-08-02 – 2026-08-0212026-10-20T19:45:04.9229482Z
2026-08-01 – 2026-08-0122026-10-20T19:45:04.9229482Z
2026-07-31 – 2026-07-3122026-10-20T19:45:04.9229482Z
2026-07-30 – 2026-07-3012026-10-20T19:45:04.9229482Z
2026-07-23 – 2026-07-2312026-10-20T19:45:04.9229482Z

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
2.0.1321 Jan 20180

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
acrisel/acrilog

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 18:25 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:221fdfeb4dd781a3dddc87c6b2299a836c1a04c4db73fc36b4e4b2331a56d42a