blob: 406033bebdefd7b1c7517594c5f82f81f8bac23f [file] [log] [blame] [view]
Daniel Eratace8d3622017-12-20 23:27:241# Chrome Logging on Chrome OS
2
3## Locations
4
5Messages written via the logging macros in [base/logging.h] end up in different
6locations 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 Bhandarkarc378f12b22019-02-18 10:10:5713 logged in. It also contains messages written after login on test images, where
14 chrome runs with `--disable-logging-redirect`.
Daniel Eratace8d3622017-12-20 23:27:2415* `/home/chronos/user/log/chrome` contains messages that are written while a
Achuith Bhandarkarc378f12b22019-02-18 10:10:5716 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 Eratace8d3622017-12-20 23:27:2418
19All of the above files are actually symlinks. Older log files can be found
20alongside them in the same directories.
21
22Also notable is `/var/log/messages`. This file contains general syslog messages,
23but it also includes messages written by `session_manager` that may be useful in
24determining when or why Chrome started or stopped.
25
26## Severity
27
28By default, only messages logged at severity `WARNING` or higher are written to
29disk. More concretely, `LOG(INFO)` messages are discarded.
30
Ian Barkley-Yeung5e0d3702019-01-04 19:10:3931To enable `LOG(INFO)` message, pass `--log-level=0` to Chrome. See the
Daniel Eratace8d3622017-12-20 23:27:2432[Passing Chrome flags from session_manager] document for more details, and
33specifically the `/etc/chrome_dev.conf` mechanism that can be used to
34change flags on development devices.
35
Ian Barkley-Yeung5e0d3702019-01-04 19:10:3936## Verbose Logging
37
38When actively debugging issues, Chrome's `--vmodule` flag is sometimes used to
39temporarily log messages at lower severities for particular modules.
40
Daniel Eratace8d3622017-12-20 23:27:2441[base/logging.h]: ../base/logging.h
John Palmer046f9872021-05-24 01:24:5642[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