Skip to content

Commit 82d6b6b

Browse files
authored
Make exported journalctl logs less verbose and always display everything (#2101)
## Description There was a recent occurance of journalctl logs saying something like `[66B blob data]`. We don't log anything binary, so journalctl might be hiding some lines, thinking they're actually binary data when they're actually plain text. Use `-a` to always log everything. If it's binary data anyways, we'll want to know what it is anyways. Use `--output cat` because we output our own timestamps and we don't want journalctl's own timestamping. Filter the output through `sed` to remove ANSI color codes to make reading logs easier. ## Meta Merge checklist: - [x] Pull Request title is [short, imperative summary](https://cbea.ms/git-commit/) of proposed changes - [x] The description documents the _what_ and _why_ - [x] If this PR changes behavior or adds a feature, user documentation is updated - [ ] If this PR touches photon-serde, all messages have been regenerated and hashes have not changed unexpectedly - [ ] If this PR touches configuration, this is backwards compatible with settings back to v2025.3.2 - [ ] If this PR touches pipeline settings or anything related to data exchange, the frontend typing is updated - [ ] If this PR addresses a bug, a regression test for it is added
1 parent 8ec0414 commit 82d6b6b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

docs/source/docs/troubleshooting/unix-commands.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,13 @@ systemctl status photonvision
122122
View the PhotonVision logs:
123123

124124
```
125-
journalctl -u photonvision
125+
journalctl --output cat -u photonvision
126126
```
127127

128128
View the PhotonVision logs in real-time:
129129

130130
```
131-
journalctl -u photonvision -f
131+
journalctl --output cat -u photonvision -f
132132
```
133+
134+
`--output cat` is used to prevent journalctl from printing its own timestamps, because we log our own timestamps.

photon-server/src/main/java/org/photonvision/server/RequestHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ public static void onLogExportRequest(Context ctx) {
435435
// dmesg = output all kernel logs since current boot
436436
// cat /var/log/kern.log = output all kernel logs since first boot
437437
shell.executeBashCommand(
438-
"journalctl -u photonvision.service > "
438+
"journalctl -a --output cat -u photonvision.service | sed -E 's/\\x1B\\[(0|30|31|32|33|34|35|36|37)m//g' >"
439439
+ tempPath.toAbsolutePath()
440440
+ " && dmesg > "
441441
+ tempPath2.toAbsolutePath());

0 commit comments

Comments
 (0)