You saw a mysterious message on a Xiaomi smartphone screen saying, "You're going to save software logs" -- and you don't know what to do next? Don't press buttons at random. This request appears in critical situations: when a system crashes, before resetting to factory settings, or during diagnostics through the Mi Flash Tool. Logs are detailed records of the device's operation that help Xiaomi engineers identify the causes of the malfunction.
In this article, we will explain why these logs are needed, where they are saved, and how to do so without the risk of losing data or exacerbating the problem. You will also learn where to send collected files if you need help from support, and how to analyze logs yourself using specialized tools.
What are software logs (logs) in Xiaomi
Software logs (or logs) are text files that record everything that happens in Xiaomiβs system, from app launches to kernel errors, and are divided into several types:
- π± System logs β records of Android, drivers and services (e.g. logcat, dmesg).
- π§ Application Logs β Data about specific programs (for example, Mi Home or Camera).
- π Logs of hardware components - information about the work of the processor, memory, communication module.
- β οΈ Error Logs β Critical failures leading to a reboot or βbrickβ of a device.
In Xiaomi devices, logs are stored in a folder /data/log (It's only available with root rights, or in temporary buffers, and when the system suggests that you save it, it archives that data into a file that you can either transfer to support or analyze yourself. 5 MB up to 500 MB depending on model and collection time.
β οΈ Note: If a log saving message appears after a failed update or reset, donβt ignore it. In 80% of cases, these files contain the key to recovering the device.
What cases Xiaomi asks to save the logs
The system automatically offers to save logs in the following scenarios:
| Script | Reason for collecting dens | The risk of neglect |
|---|---|---|
| Misfire of MIUI Update | Error when installing firmware via Updater or Fastboot | High (possible "brick") |
| Hanging on the Mi logo | Critical error of the bootloader or kernel | Medium (the device may not be switched on) |
| Automatic reboot | Hardware failure (overheating, memory problems) | Low (but may recur) |
| Diagnostics through Mi Service Center | Request of the service center for warranty repair | Denial of repair without logs |
The request may also be made when:
- π Use of the Fastboot mode or EDL (For Firmware with Mi Flash Tool).
- π οΈ Activate the hidden menu of engineering settings (#4636##).
- π± Connecting to PC via Mi PC Suite with enabled debugging USB.
Step-by-step: how to save logs on Xiaomi
If a window appears on the screen with a suggestion to save logs, follow this algorithm:
Connect the device to charge (the process can take up to 30 minutes)
Make sure that the device has enough memory (minimum 500MB free)
Do not interrupt the process even if the screen is βhangingβ.
After saving, check the folder. MIUI/debug_log download
-->
1. Confirm Save: Press OK or Save in the window that appears. If the device does not respond to touch, use the Volume Up button combination + Power (for models with physical buttons).
2. Wait until it is completed: The process can take 2 to 30 minutes depending on the amount of data. The screen will display a progress bar or the inscription Collecting logs... Do not turn off the device and do not remove the battery!
3. Check the result:
- π The file will be saved in the folder. MIUI/debug_log or Download with a name of a species log_YYYYMMDD_HHMMSS.zip.
- π§ If the save is initiated through Mi Service Center, the file can be automatically sent to the Xiaomi server.
4. Pass the logs in support (if required):
- π© Through the feedback form on the site mi.com/support.
- π οΈ When visiting the service center in person (save the file to the flash drive).
β οΈ Note: If the device stopped turning on after saving the logs, this means that the failure was critical. In this case, do not try to stitch it yourself - contact the service center indicating that the logs have already been collected.
adb pull /data/logThis command will copy all available logs to the computer, even if the screen is not working.-->
What to do with saved journals
Collected logs are a valuable diagnostic tool, and here's how you can use them:
1. Self-analysis
To view the logs suitable programs:
- π₯οΈ Logcat Reader (for logcat)
- π Notepad++ with the Compare plugin (to find errors)
- π Android Studio (built-in Logcat)
Look for the key words in the files:
- E/ (mistake), FATAL (fault-break), ANR (hanging-up).
- bootloop (cyclic reboot), brick (bricking).
2.Sending in support of Xiaomi
When you contact the service:
- π Attach the archive with logs to the ticket.
- π Specify the device model, version MIUI description of the problem.
- π Tell the date and time of the log collection (this will help engineers match the data).
3. Use to unlock the loader
If you unlock Bootloader through the Mi Unlock Tool, logs may be needed to:
- π Proof of the reason for blocking (for example, if the device was blocked due to suspicious activity).
- π‘ Evidence that the failure was not the userβs fault (e.g., when an automatic update occurred).
How to read logs without special programs?
Errors in saving logs and their solutions
The process of collecting logs may not go according to plan. Let's look at the typical problems and ways to fix them:
| Mistake. | Reason. | Decision |
|---|---|---|
| The process "hangs" by 0% | Damaged section. /data or lack of memory | Free up space or save logs through ADB |
| No file is created. | No permission to write to the folder | Try to save it on SD-map |
| The device is rebooting. | The critical error of the nucleus | Logs are collected in Fastboot (fastboot oem dump) mode. |
| Logs empty or damaged | Buffer failure of the lairs | Restart the device and re-collect |
If none of the methods helped, and the device is not turned on, the last option remains - firmware in mode. EDL (In this case, the logs can be collected only after the recovery of functionality.
β οΈ Warning: If you keep your logs, the device is turned off and not turned on, do not connect it to charging for a long time. In 30% of cases, this leads to damage to the power controller due to unstable voltage.
How to prevent data loss when collecting logs
Keeping logs is not a safe process, so you can minimize the risks.
Backup important data (photos, contacts) via Mi Cloud or ADB backup
Disable two-factor authentication in your Xiaomi account (in case of reset)
Charge the device to at least 50% (collecting logs consumes a lot of energy)
Use the original cable USB PC-connect
-->
Backup:
- π± Through Settings. β The phone. β Backup.
- π₯οΈ Through ADB: adb backup -apk -obb -shared -all -f backup.ab
Memory check:
Make sure that the device has at least 1 GB of free space. Logs can take up to 500 MB, and temporary files can take up to the same. β Warehouse.
Stable nutrition:
If the device runs out during log collection, it can damage system files, connect it to a power source and wait until the charge reaches at least 30%.
Use of PC:
If the screen is not responsive, but the device is determined by the computer, save the logs through the ADB:
adb shell
su
logcat -d > /sdcard/logcat.txt
exit
exit
adb pull /sdcard/logcat.txtπ‘
Never save logs on a device with a corrupted file system (for example, after a failed formatting) and this can result in complete data loss.
Alternative ways to collect logs without requesting the system
If the device works but you need to collect logs for diagnosis (for example, for catching bugs in custom firmware), use these methods:
1. via ADB (for power users)
Connect the device to the PC with debugging enabled USB (Settings β For developers β Debugging by USB) and do it:
adb logcat -v time -d > mi_logs.txtTo collect extended logs (including the kernel):
adb shell dmesg > kernel_logs.txt
adb shell cat /proc/last_kmsg > last_kmsg_logs.txt2. Through the annexes
Install from Google Play:
- π± Logcat Extreme β for viewing logs in real time.
- π aLogcat β a lightweight application with error level filters.
- π§ MatLog β Supports cloud-based saving.
3. Through the engineering menu
Dial on the phone keyboard:
##4636##Go to Usage statistics and click Dump to file. /sdcard/.
β οΈ Note: Collecting logs through an engineering menu can reset some network settings (e.g, APN). After the procedure, check the mobile Internet.