[RFC] Logging events and jobs in Upstart
james.hunt at canonical.com
Fri Jun 17 20:09:50 UTC 2011
-----BEGIN PGP SIGNED MESSAGE-----
I'd like to get some discussion going about the logging of events and jobs in Upstart.
Scott has done some great work recently wrt the kmsg change  such that you can now see everything
from the "startup" event onwards if you boot with --debug/--verbose and configure your syslog daemon
The ability to have a log of all Upstart events is invaluable, particularly for servers which have
been up for aeons as it helps users and admins learn more about their own particular set of event flows.
I'm wondering therefore if it is worth taking the logging a step further by considering one of the
following (or any other ideas readers have of course):
1) Making Upstart default to logging event/job state messages.
We might need to change some of the formatting a little to make it more palatable to admins, but
the work is essentially already done.
2) Have Upstart store a log of event+job details *internally*.
I'm not suggesting we necessarily do this, but I think it's an interesting idea so I'd like to share
The thought is that we introduce a new configure option (default disabled) which if enabled would
make upstart store internally the name/env/exit status? (and maybe some sort of timestamp) for every
event and job it runs.
The problem with this is:
- - the data isn't viewable anywhere.
- - assuming a linear log , more and more memory is being consumed (a bad thing for init generally)
The solution to this is 2 new initctl commands:
This command would write the internal log to stdout. However, if you ran it like this...
This would make init free its internal log.
Now, as long as clear-internal-log is called at some "reasonable" point in the boot, we have the
ability to see exactly what events were emitted and what jobs were run, the relative order and we
stop init gobbling up ever increasing amounts of memory.
 - https://lists.ubuntu.com/archives/upstart-devel/2011-February/001409.html
 - we could of course consider a circular log.
Ubuntu Foundations Team, Canonical.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
-----END PGP SIGNATURE-----
More information about the upstart-devel