cron scripts should log everything, but only send mail for errors
Bug #640125 reported by
Martin Pool
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
Medium
|
Stuart Bishop |
Bug Description
I think we want all cronscripts to
- emit to stderr (and from there through cron to mail) all messages of severity ERROR or higher
- send everything to a log file (i guess opened directly, unless we especially want to go through syslog)
This should be pretty easy to do on top of python logging; we just need to decide what configuration options if any are needed. (Perhaps there is some standard argv->logging mapping?)
See launchpad-dev thread "cron script error output handling".
Related branches
lp:~stub/launchpad/cronscripts
- Robert Collins (community): Approve
- Canonical Launchpad Engineering: Pending requested
-
Diff: 1068 lines (+537/-90)16 files modifiedlib/canonical/launchpad/scripts/logger.py (+147/-61)
lib/canonical/launchpad/scripts/tests/loglevels.py (+9/-10)
lib/canonical/launchpad/scripts/tests/test_logger.txt (+28/-5)
lib/canonical/launchpad/scripts/tests/test_scriptmonitor.py (+1/-1)
lib/canonical/launchpad/webapp/errorlog.py (+5/-4)
lib/lp/codehosting/codeimport/tests/test_dispatcher.py (+11/-0)
lib/lp/services/log/loglevels.py (+91/-0)
lib/lp/services/log/mappingfilter.py (+27/-0)
lib/lp/services/scripts/base.py (+60/-3)
lib/lp/services/scripts/doc/launchpad-scripts.txt (+39/-0)
lib/lp/services/scripts/tests/cronscript-crash.py (+44/-0)
lib/lp/services/scripts/tests/test_doc.py (+7/-2)
lib/lp/translations/doc/remove-translations-by.txt (+2/-2)
lib/lp/translations/scripts/tests/test_reupload_translations.py (+4/-2)
lib/lp_sitecustomize.py (+56/-0)
scripts/branch-rewrite.py (+6/-0)
Changed in launchpad-foundations: | |
assignee: | nobody → Stuart Bishop (stub) |
importance: | Undecided → Medium |
status: | New → In Progress |
Changed in launchpad-foundations: | |
status: | In Progress → Fix Committed |
tags: |
added: qa-ok removed: qa-needstesting |
Changed in launchpad-foundations: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
I think the "send everything to a logfile" part is something we should just be defining in the crontab entry. Otherwise we'd have to define log file locations for every individual script and changing them would be unnecessarily complex.