Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arteria/alogator
Alogator is an aggregated logging actor system based on Django.
https://github.com/arteria/alogator
Last synced: 20 days ago
JSON representation
Alogator is an aggregated logging actor system based on Django.
- Host: GitHub
- URL: https://github.com/arteria/alogator
- Owner: arteria
- License: mit
- Created: 2013-11-04T21:47:33.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2017-12-04T13:58:15.000Z (almost 7 years ago)
- Last Synced: 2024-10-01T15:13:59.445Z (about 1 month ago)
- Language: Python
- Homepage: http://arteria.github.io/alogator/
- Size: 42 KB
- Stars: 5
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.txt
- License: LICENSE
Awesome Lists containing this project
- starred-awesome - alogator - Alogator is an aggregated logging actor system based on Django. (Python)
README
Alogator
============Alogator is an aggregated logging actor system.
.. contents:: Table of Contents
Installation
------------To get the latest stable release from PyPi
.. code-block:: bash
pip install alogator
To get the latest commit from GitHub
.. code-block:: bash
pip install -e git+git://github.com/arteria/alogator.git#egg=alogator
.. TODO: Describe further installation steps (edit / remove the examples below):
Add ``alogator`` to your ``INSTALLED_APPS`` and define a logger
.. code-block:: python
INSTALLED_APPS = (
...,
'alogator',
)LOGFILE_PATH = os.path.join(os.path.join(BASE_DIR, 'logs/'), "alogator.log")
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
'formatters': {
'standard': {
'format': "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s",
'datefmt': "%d/%b/%Y %H:%M:%S"
},
},
'handlers': {
'logfile': {
'level': 'DEBUG',
'class': 'logging.handlers.RotatingFileHandler',
'filename': LOGFILE_PATH,
'maxBytes': 1000000,
'backupCount': 0,
'formatter': 'standard',
}
},
'loggers': {
'alogator': {
'handlers': ['logfile'],
'level': 'DEBUG',
},
}
}Don't forget to create the tables for your database
.. code-block:: bash
./manage.py syncdb alogator
# python manage.py migrateUsage
-----Setup your logfiles, search patterns and actors in the admin backend.
To run one (scan all logfiles for patterns) just call the ``scanlogfiles`` management command.
.. code-block:: bash
python manage.py scanlogfilesYou can use ``alogator_cli`` to check the log files in a project. Simple add paths to settings files as arguments. Be aware that you have to run the project, so you need to first activate your virtualenv if you have one.
.. code-block:: bash
# if you have a virtualenv
. /path/to/env/bin/activatealogator_cli /path/to/project/settings.py
To run this continously you could setup a cronjob. For example, to run this every other minute use
.. code-block:: bash
crontab -e
Than add.. code-block:: bash
*/2 * * * * /path/to/your/manage.py scanlogfiles
You may have to activate your virtualenv depending on your setup.TODO
----* Customizable temporary working dir instead of /tmp
* Customizable subject, eg. [Alogator] (to filter inbox)
* Add "To mute this actor, visit..." in message/email.Histroy
-------Please refer to CHANGELOG.txt
Contribute
----------If you want to contribute to this project, simply send us a pull request. Thanks. :)