Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/LucasMagnum/django-simple-logger
Simple Logger is a Django app that provides an easy way to you record yours system logging messages and request exceptions.
https://github.com/LucasMagnum/django-simple-logger
Last synced: about 2 months ago
JSON representation
Simple Logger is a Django app that provides an easy way to you record yours system logging messages and request exceptions.
- Host: GitHub
- URL: https://github.com/LucasMagnum/django-simple-logger
- Owner: LucasMagnum
- License: bsd-2-clause
- Created: 2013-12-03T18:44:18.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-04-28T14:43:03.000Z (over 10 years ago)
- Last Synced: 2024-07-24T21:06:54.589Z (about 2 months ago)
- Language: Python
- Size: 230 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
=====
Simple Logger
=====
Simple Logger is a Django app that provides an easy way to you record on database
yours system logging messages and request exceptions.How install
------------::
pip install -e git+git://github.com/LucasMagnum/django-simple-logger#egg=simplelogger
Quick start
-----------1. Add "simplelogger" to your INSTALLED_APPS setting like this::
INSTALLED_APPS = (
...
'simplelogger',
)2. Add the "simplelogger_dbhandler" to your LOGGING setting like this::
LOGGING = {
...'handlers': {
...
'simplelogger_dbhandler': {
'class': 'simplelogger.handlers.DBLogRecordHandler'
},
},}
3. Now, you can use "simplelogger_dbhandler", if you want log all messages from `simplelogger`, do that::
# Use a specific logger "simplelogger"
LOGGING = {'loggers': {
...'simplelogger': {
'handlers': ['simplelogger_dbhandler'],
'level': 'DEBUG',
'propagate': False,
}
}
}# Log all messages
LOGGING = {'loggers': {
...'': {
'handlers': ['simplelogger_dbhandler'],
'level': 'DEBUG',
'propagate': False,
}
}
}
4. Run `python manage.py syncdb` to create the simple logger models.
5. Start the development server and visit http://127.0.0.1:8000/admin/
and you can see the log (you'll need the Admin app enabled).Commands
--------+-----------+-------------------------+-------------------------------+
| Command | Action |
+=====================================+===============================+
| simplelogger_cleanup | Delete logs and exceptions |
+-------------------------------------+-------------------------------+
| simplelogger_cleanlogs | Delete logs |
+------------------------+------------+-------------------------------+
| simplelogger_cleanexceptions | Delete exceptions |
+-------------------------------------+-------------------------------+Parameters:
--days=DAYS all commands accept a number of days to delete records.
Reference
---------Django logging documentation: https://docs.djangoproject.com/en/1.5/topics/logging/
Python logging documentation: http://docs.python.org/2.7/library/logging.html#module-logging
Issues
---------
https://github.com/LucasMagnum/django-simple-logger/issues