Daniel Erat | ace8d362 | 2017-12-20 23:27:24 | [diff] [blame] | 1 | # Chrome Logging on Chrome OS |
| 2 | |
| 3 | ## Locations |
| 4 | |
| 5 | Messages written via the logging macros in [base/logging.h] end up in different |
| 6 | locations depending on Chrome's state: |
| 7 | |
| 8 | * `/var/log/ui/ui.LATEST` contains data written to stdout and stderr by Chrome |
| 9 | (and technically also [session_manager]). This generally comprises messages |
| 10 | that are written very early in Chrome's startup process, before logging has |
| 11 | been initialized. |
| 12 | * `/var/log/chrome/chrome` contains messages that are written before a user has |
Achuith Bhandarkar | c378f12b2 | 2019-02-18 10:10:57 | [diff] [blame] | 13 | logged in. It also contains messages written after login on test images, where |
| 14 | chrome runs with `--disable-logging-redirect`. |
Daniel Erat | ace8d362 | 2017-12-20 23:27:24 | [diff] [blame] | 15 | * `/home/chronos/user/log/chrome` contains messages that are written while a |
Achuith Bhandarkar | c378f12b2 | 2019-02-18 10:10:57 | [diff] [blame] | 16 | user is logged in on non-test images. Note that this path is within the user's |
| 17 | encrypted home directory and is only accessible while the user is logged in. |
Daniel Erat | ace8d362 | 2017-12-20 23:27:24 | [diff] [blame] | 18 | |
| 19 | All of the above files are actually symlinks. Older log files can be found |
| 20 | alongside them in the same directories. |
| 21 | |
| 22 | Also notable is `/var/log/messages`. This file contains general syslog messages, |
| 23 | but it also includes messages written by `session_manager` that may be useful in |
| 24 | determining when or why Chrome started or stopped. |
| 25 | |
| 26 | ## Severity |
| 27 | |
| 28 | By default, only messages logged at severity `WARNING` or higher are written to |
| 29 | disk. More concretely, `LOG(INFO)` messages are discarded. |
| 30 | |
Ian Barkley-Yeung | 5e0d370 | 2019-01-04 19:10:39 | [diff] [blame] | 31 | To enable `LOG(INFO)` message, pass `--log-level=0` to Chrome. See the |
Daniel Erat | ace8d362 | 2017-12-20 23:27:24 | [diff] [blame] | 32 | [Passing Chrome flags from session_manager] document for more details, and |
| 33 | specifically the `/etc/chrome_dev.conf` mechanism that can be used to |
| 34 | change flags on development devices. |
| 35 | |
Ian Barkley-Yeung | 5e0d370 | 2019-01-04 19:10:39 | [diff] [blame] | 36 | ## Verbose Logging |
| 37 | |
| 38 | When actively debugging issues, Chrome's `--vmodule` flag is sometimes used to |
| 39 | temporarily log messages at lower severities for particular modules. |
| 40 | |
Daniel Erat | ace8d362 | 2017-12-20 23:27:24 | [diff] [blame] | 41 | [base/logging.h]: ../base/logging.h |
John Palmer | 046f987 | 2021-05-24 01:24:56 | [diff] [blame^] | 42 | [session_manager]: https://chromium.googlesource.com/chromiumos/platform2/+/main/login_manager/ |
| 43 | [Passing Chrome flags from session_manager]: https://chromium.googlesource.com/chromiumos/platform2/+/main/login_manager/docs/flags.md |