Skip to content

Commit

Permalink
Merge branch 'jf/purge' of github.com:gnulnx/django-mongolog into jf/…
Browse files Browse the repository at this point in the history
…purge
  • Loading branch information
Furr committed Sep 26, 2018
2 parents 587a354 + 003dc1c commit c406ef3
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,16 @@ Quick start
'mongolog': {
'level': 'DEBUG',
'class': 'mongolog.SimpleMongoLogHandler',
'connection': 'mongodb://localhost:27017'
# Set the connection string to the mongo instance.
'connection': 'mongodb://localhost:27017',
# define mongo collection the log handler should use. Default is mongolog
# This is useful if you want different handlers to use different collections
'collection': 'mongolog'
},
},
# Define a logger for your handler. We are using the root '' logger in this case
'loggers': {
'': {
'handlers': ['mongolog'],
Expand Down Expand Up @@ -220,6 +227,20 @@ Quick start
"trace" :
null
}
Management Commands (Django Only)
---------------------------------

1) ml_purge::

The ml_urge command is used to clean up mongo collections. The command has two basic modes: --purge and --delete. Purge will remove all documents and delete will remove documents older than {n} day's.

To backup and PURGE all documents from the collection defined in mongolog handler
./manage.py ml_purge --purge --backup -logger mongolog

To remove all documents older than 14 days without backing up first
./manage.py ml_purge --delete 14 -logger mongolog


Future Roadmap
---------------
Expand Down

0 comments on commit c406ef3

Please sign in to comment.