https://github.com/magervalp/newloglines
Print out lines that have been added to a log file.
https://github.com/magervalp/newloglines
Last synced: 12 months ago
JSON representation
Print out lines that have been added to a log file.
- Host: GitHub
- URL: https://github.com/magervalp/newloglines
- Owner: MagerValp
- Created: 2013-08-30T09:20:02.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2013-08-30T09:20:05.000Z (almost 13 years ago)
- Last Synced: 2025-02-09T19:18:14.281Z (over 1 year ago)
- Language: Python
- Size: 102 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
NewLogLines
===========
newloglines.py is a small utility that prints out lines that have been added to a log file since the last time it was run. It's meant to be run from a crontab, for example if you want to check for new log entries once per hour:
MAILTO=rolloutteam@cgnu.edu
0 * * * * /usr/local/bin/newloglines.py /var/db/newloglines/log.db /var/log/assetsync.log
It saves the last log line in a small database, which can be shared for all logs that a user is watching. I'm using it for a few non-critical tasks like notifying our rollout team when the asset database has been updated. It makes no effort to handle unexpected events gracefully so NewLogLines is a complement to, not a replacement for, a proper [centralized logging solution](https://www.google.com/search?q=site%3Astackoverflow.com+centralized+logging).
Requirements
------------
Python 2.6+ with the built-in sqlite3 module, tested on OS X 10.6-10.8 and RHEL 6.
License
-------
Copyright 2013 Per Olofsson
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.