feat(crashpad): capture handler logs (+ client stderr)#1658
Conversation
|
5a1e927 to
c9d0e55
Compare
fe3e4d2 to
bb9e626
Compare
<run>/crashpad.log|
@JoshuaMoelans What do you think about P.S. Neither of them barely logs almost anything at all. They seem to be mostly errors only. |
|
@jpnurmi yeah that sounds good, it's where I would expect these logs to show up (crashpad being a different process, I also don't mind it not going to |
|
@JoshuaMoelans What about the client side that lives in the same process? It can also print useful errors, such as We can either capture client-side errors into STDERR so that it gets mixed in the sentry output (notice one message from Alternatively, we can capture it to C:\Users\jpnurmi\Projects\sentry\sentry-playground>type build\.sentry-native\c6a43bc8-2629-492d-e79c-94cb114aff09.run\crashpad-client.log
[19168:9228:20260420,170017.136:ERROR crashpad_client_win.cc:615] CreateProcess: %1 is not a valid Win32 application. (193)Or, we can combine both so that you get |
|
@jpnurmi ah, in that case I think having it as part of the actual debug logs next to the Sentry ones could be helpful when debugging user's issues, since we usually have them send us the debug log outputs (and then having to look through the log file and the console output seems like a bit of double work). I think I misunderstood the |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1077743. Configure here.
53a695e to
3d8e4e4
Compare
3d8e4e4 to
0ed34e1
Compare
Pass `--log-file=<run>/crashpad.log` to crashpad_handler so its log output is written to the run directory alongside other session files. The log is cleaned up with the rest of the `.run` directory on the next `sentry_init`, so it doesn't bloat the database. When `debug` is enabled, also forward the SDK's log level via `--log-level=N` so the handler's log file matches the configured verbosity (otherwise crashpad stays at its built-in default). TRACE and DEBUG map to mini_chromium's `LOG_VERBOSE`, FATAL to `LOG_FATAL`, the rest 1:1. Closes #1468 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0ed34e1 to
ce0b2da
Compare

Capture
crashpad_handler's log output in the run directory:<run>/crashpad-handler.log. The log file is automatically cleaned up with the rest of the.rundirectory on the nextsentry_init, so it doesn't bloat the database. Whendebugis enabled, forward the SDK's log level via--log-level=Nso the file matches the configured verbosity.TRACEandDEBUGmap tomini_chromium'sLOG_VERBOSE,FATALtoLOG_FATAL, the rest 1:1.As a side bonus, client-side logs are also routed to stderr when
debugis enabled — previously only POSIX routed non-ERRORlevels there by default.Example:
See also:
Close: #1468