A Remote Rotating Log for Python that works instantly
rrlog is a pure Python logging tool. It is for both debugging and production, and logs on a website with reasonable traffic for some years now. It supports:
Most battery types included
Everything works instantly except database logging (that needs the SqlAlchemy package in your python path).
Where it sucks
There are at least the following caveats:
Major improvements likely to come next are:
Various create() functions are available. These make different log configurations, e.g. for local or remote logging, into a file or a database etc. For the create...() functions available, look into the Basic Examples
That log object is callable. Call it with these arguments:
That log object can be used as it is. Alternatively, you may want to Use Pythons standard logging. The log can be simply integrated as a handler there.
The meaning of the optional category (here: “E”) is up to you, i.e. application specific. By recommended convention, “E” indicates an Error, “W” a warning.
Custom categories can fit our specific needs. For example, “S” may report security relevant messages, like someone trying strange URLs on your website. “U” may mark significant user actions that track the way your application is used. “M” might say “a user wrote a message in your contact formular”. By default, these category characters appear leftmost in each logged line (which is configurable).
We can later use that category to extract a log file summary, e.g. for the specific purpose “watch the user behaviour”. rrlog can also Send mails for selected categories. For example, we may want emails for security relevant messages. Or, with every text a user typed into the contact formular, we log an “M” message. The rrlog can immediately send an email with that text content.
Now for something completely different ...
When using database logging, the SQLAlchemy library is required. File logging needs no additional library.
Only this environment is tested. But we aim to minimize dependency trouble by supporting a wide range of Python and SQLAlchemy versions. There’s a wide version range expected to work:
(Anyway, with database logging, a newer SQLAlchemy may require a newer Python.)
If some of these “supported versions” don’t work, it is considered a bug. Please tell (Contact)
Python 3 You may already try the experimental lib3k/ directory (instead of lib/). This is made by the 2to3 tool of Python.
Bug reports, improvements ...
Mail to rrlog at reifenberg.de
Or see http://www.reifenberg.de/rrlog/ or the sourceforge site Sourceforge
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1. LICENSE FOR THIS SOFTWARE EXCEPT FOR BUNDLED SOFTWARE The following license (FreeBSD) applies to all of this software, except for the bundled "simplejson" software package. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Copyright (c) 2007 Ruben Reifenberg. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2. LICENSE FOR BUNDLED SOFTWARE The following license applies to the "simplejson" package which is located in the "fbsimplejson" subdirectory. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Copyright (c) 2006 Bob Ippolito Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.