Re: Newbie: Writing console messages to a file FC2 2.6.5

From: Phil Schaffner (Philip.R.Schaffner_at_NASA.GOV)
Date: 08/02/05

  • Next message: Bill West: "Re: making Samba work"
    To: For users of Fedora Core releases <fedora-list@redhat.com>
    Date: Tue, 02 Aug 2005 15:31:27 -0400
    
    

    On Tue, 2005-08-02 at 12:09 +0100, Clive at Rational wrote:
    > Hello,
    >
    > I have an unreliable FC2 / 2.6.5 kernel machine. I
    > am running it as a file server. From time to time the
    > machine "hangs" or puts out lots of messages of the
    > form
    >
    > <+0x0nnnnnnn> ... debug info ...
    >
    > I am guessing these are kernel error messages. I
    > want to capture these messages so I can post them when
    > an error occurs. At the moment the messages are not
    > written to any file that I can find - so I can't
    > retreive them, then post them once I restart the
    > machine.
    >
    > Now the reading I have done has got me as far this
    > this .....
    >
    > The kernel messages are directed to the console
    > because of the following setting
    >
    > /etc/syslog.conf
    > # Log all kernel messages to the console.
    > # Logging much else clutters up the screen.
    > kern.* /dev/console
    >
    >
    > My question is
    >
    > Can I change this to
    > # Log all kernel messages to the console.
    > # Logging much else clutters up the screen.
    > kern.* /syslog/CRLconsolelog

    Probably want to log in /var/adm or /var/log.

    > So all messages are written to a file?
    >
    > Can I get the messages written to BOTH a file and the
    > console at the same time?

    The man page on syslog.conf has some examples:

           This will store all messages with the priority crit in the
    file /var/adm/critical, except for any kernel message.

                  # Kernel messages are first, stored in the kernel
                  # file, critical messages and higher ones also go
                  # to another host and to the console
                  #
                  kern.* /var/adm/kernel
                  kern.crit @finlandia
                  kern.crit /dev/console
                  kern.info;kern.!err /var/adm/kernel-info

    >
    > Will this capture ALL Error messages that appear at
    > the console?
    >
    > What happens if the machine goes into a loop - I don't
    > realise - and eventually the file fills the whole
    > disk? Will I then be able to restart Linux?
    >
    > Anyway of cycling this "kernel/console message" log
    > file automatically?

    Yes. See /etc/logrotate.d/ for some examples, and the logrotate man
    page.

    Phil

    -- 
    fedora-list mailing list
    fedora-list@redhat.com
    To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list
    

  • Next message: Bill West: "Re: making Samba work"

    Relevant Pages

    • Newbie: Writing console messages to a file FC2 2.6.5
      ... I am guessing these are kernel error messages. ... The kernel messages are directed to the console ... # Logging much else clutters up the screen. ...
      (Fedora)
    • Re: Slices
      ... messages n) and, for whatever reason, say, it's not time, newsyslog hasn't rotated the logfiles yet. ... error messages to syslogd....) ... you'll be able to get up in single-user from the console. ... relatively full of holes, but there *was* a reason why ...
      (freebsd-questions)
    • Re: Controlling COBOL DDs named SYSOUT
      ... On Dec 27, 2007, at 4:29 PM, Tom Marchant wrote: ... What about error messages to be issued when the program terminates ... One of the many standards we implemented at a company I worked for was that a program could *NOT* use display upon console for *ANYTHING*. ... When MVS first came out 2.0 there were in fact many D23 abends and any program that had a WTOR outstanding took the abend. ...
      (bit.listserv.ibm-main)
    • Re: Bothering error message when logging out X
      ... other kernel messages (e.g. like when you plug in a USB device)? ... so to stop low-level messages on console, and that bothering message did not ... How can I avoid this as well, and all undesired kernel messages? ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
      (Debian-User)
    • Re: stop kernel messages from splashing on the console
      ... I am getting these kernel messages on the consoles which I want to avoid ... From the man pages it is not clear to me if syslog actually handles the internal kernel messages going to the console, there is also klogd, and I know internal messages still make it to the console even when userspace is screwed up badly, so I would suspect that the klogd thread in the kernel is handling it. ...
      (Fedora)