# Capture the kernel logs

To capture Linux kernel logs, you can use several methods depending on your system setup and the level of detail required. These logs provide critical insights into system behavior, helping you identify issues and monitor kernel-level events.

## Capture the serial console logs

Standard boot and kernel logs are accessible using a serial console. The serial console allows live debugging on a live device. The Qualcomm Linux kernel allows the `CONFIG_SERIAL_QCOM_GENI` driver to support UART and
console.

Add the following line to the kernel command-line parameter:

console=ttyMSM0,115200n8
    
    # as in following line in meta-qcom-hwe/conf/machine/include/qcom-<SoC>.conf
    KERNEL_CMDLINE_EXTRA ?= "root=/dev/disk/by-partlabel/system rw rootwait console=ttyMSM0,115200n8 pcie_pme=nomsi earlycon"
    Copy to clipboard

When you rebuild and load the kernel:

- Connect a Micro USB to USB-A type cable as follows:

    - Device &gt; Micro USB====USB-TypeA &gt; host computer
- To connect to a device serial port on the host, use a serial console client on a host computer.
- You can see serial console logs and other kernel logs on serial client.

For more information about the serial console, see [Linux Serial
Console](https://docs.kernel.org/admin-guide/serial-console.html).

## Configure the console log level

Configure the kernel console log level for extensive or minimal logging to comply with debug or release software requirements.

Use `/proc/sys/kernel/printk` to configure log level to control log messages appearing on the console. Set the log level from 1 to 7.

When you set the log level value to 1, it filters the log to the lowest level. When the log level value is set to 1,
only `pr_emerg/KERN_EMERG` printk logs are printed.

When you set the log level value to 7, it enables the highest log level `pr_info/KERN_INFO` and prints all printk logs to the console.

echo "1" > /proc/sys/kernel/printk
    Copy to clipboard

## Display kernel logs

To display the kernel logs, run one of the following commands:

- dmesg
        Copy to clipboard
- cat /proc/kmsg
        Copy to clipboard

## Display kernel logs since bootup

To display the kernel logs since bootup, run one of the following commands:

- cat /var/log/messages
        Copy to clipboard
- cat /var/log/kern.log
        Copy to clipboard

Last Published: Dec 26, 2025

[Previous Topic
Enable virtualization](https://docs.qualcomm.com/bundle/publicresource/80-70023-3/topics/virtualization.md) [Next Topic
Configure debug methods](https://docs.qualcomm.com/bundle/publicresource/80-70023-3/topics/debug.md)