31

Except doing explicit logging instructions like suggested in http://upstart.ubuntu.com/wiki/Debugging, is there a way to enable output of what is happening with upstart?

  • What event is raised
  • What service changed its status (started/stopped/dead)
  • What signal were emmited
  • what output a service produced while starting
tshepang
  • 12,111
  • 21
  • 91
  • 136
samb
  • 1,713
  • 4
  • 22
  • 31
  • 1
    Perhaps this question might be more appropriate on http://serverfault.com/ – mr.b Dec 02 '10 at 13:14
  • It's relative to both server and desktop... Should I close this one and re-open in serverfault? – samb Dec 02 '10 at 15:44

3 Answers3

36

Ok, I've found one way to get it :

$ sudo initctl log-priority        # gives the actual (default) logging level
$ sudo initctl log-priority --help # gives available logging levels
$ sudo initctl log-priority info # is enough to get :
$ tail -f /var/log/syslog        # - log of upstart events
$ tail -f /var/log/boot.log      # - log of services output
samb
  • 1,713
  • 4
  • 22
  • 31
  • 2
    hey! Ubuntu 11.10 here and there is no /var/log/boot.log for me, just /var/log/boot. That doesn't produce any process output though, i tried `echo 'hi'` and it's not showing up in /var/log/boot. Any tips? – rdrey Mar 28 '12 at 16:09
  • @rdrey: /var/log/kern.log maybe? – Atila Romero Aug 02 '12 at 20:16
  • @AtilaRomero maybe ;) I actually don't remember this question/comment at all, sorry. – rdrey Aug 02 '12 at 22:30
  • 2
    I am using Ubuntu 12.10 now, why I still cannot get the log following your steps? – Yishu Fang Apr 16 '13 at 02:57
  • You may need to add `$KLogPermitNonKernelFacility on` to rsyslogd's config, as detailed here: http://askubuntu.com/a/490900/297973 – Vanessa Phipps Jul 02 '14 at 17:16
19

In newer versions, you can find the upstart logs at:

/var/log/upstart

It has a log for each process it tries to start.

Travis Reeder
  • 38,611
  • 12
  • 87
  • 87
8

initctl log-priority info logs events, but ignores the program output.

If the program output is important to you, I think the complementary solution is to use logger in your init script:

script
    myawesomeprog 2>&1 | logger -t myawesomeprog
end script

Because it's better to use syslog than manually manage /var/log, like http://upstart.ubuntu.com/wiki/Debugging suggests (in 08/2012).

Aminah Nuraini
  • 18,120
  • 8
  • 90
  • 108
Atila Romero
  • 359
  • 3
  • 7
  • Doesn't give any output for me using: `su -c "$DAEMON $DAEMON_OPTS" $ES_USER 2>&1 | logger -t elasticsearch` – Rob Nov 08 '12 at 12:02