Logging is the process by which the system records what's going on - i.e. events, errors, warnings, and related information. Most apps provide details in log files, so the system logs help to debug problems.
Apps can provide quite extensive logging information. To be able to handle that amount of data generated, Android organizes its system logs in circular buffers (also called "ring buffer"). This way the size of the logs is fixed (and can be adjusted to available ressources); as soon as the buffer is full, older entries "age out" and get replaced by newer ones.
Android provides different tools to investigate its logs. There are several apps available at Google Play (watch for the terms "logcat" or "catlog"), but starting with JellyBean they require root access to show all available logs. From a shell (e.g. via ADB or a terminal emulator) there are several tools available by default, which require root only for a subset of their operations. Two examples include
Note that these utilities cannot provide data in the pre-boot (i.e., bootloader) stage, for that specialized debugging utilities running over UART is required.
For more details, please also see:
- How can I view and examine the Android log?
- Problems accessing message logs on Jelly Bean with aLogcat
- How can I access android log files on my Nexus 7 without root access?
- Android boot-up messages for debugging?
- Reading and Writing Logs (Android Developers, includes "Using LogCat", linked from 3)