Linux kernel log Recipe

  1. Ensure you're logged in as root.
  2. The kernel log may be quite large (e.g. multiple GB), so consider changing to a directory with plenty of free space.
  3. Execute the following command to write the kernel log to a file:
    journalctl --since "24 hours ago" &>> diag_kernel_$(hostname).txt || cat /var/log/messages &>> diag_kernel_$(hostname).txt || cat /var/log/syslog &>> diag_kernel_$(hostname).txt || dmesg &>> diag_kernel_$(hostname).txt
  4. Consider gzipping the file:
    gzip diag*txt
  5. Upload diag*