Redirect Console to a File?

Is there a way to redirect the system console (eg. where kernel panic messages go) to a file?

I found a way to redirect them to a serial port by appending “console=ttyS1,38400” to the kernel line of /boot/grub.conf, but I want to redirect it to a file… Could I just put “console=”/console.txt" or something similar?

Thanks :slight_smile:

I don’t believe it’s possible Fr3d and I think the general consensus is that the system isn’t in a state where writing to the disks would be a good idea. It’s been a few years since I’ve looked into this last so things may have changed but from what I remember that was the crux.

I also remember reading some stuff about some systems logging panics to the swap space on disks but at the time I don’t think Linux supported this.


Well the kernel panics was the first thing that came to mind… is there a way of redirecting everything else (when the system is at 100% “health”) to a file?