mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-25 00:50:31 +00:00
Flush logs on error
This commit is contained in:
parent
c6cca15a9a
commit
e89fb97d53
2 changed files with 11 additions and 0 deletions
|
@ -80,6 +80,12 @@ public class AppLogs {
|
|||
hookUpSystemErr();
|
||||
}
|
||||
|
||||
public void flush() {
|
||||
if (outFileStream != null) {
|
||||
outFileStream.flush();
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean shouldWriteLogs() {
|
||||
if (System.getProperty(WRITE_LOGS_PROP) != null) {
|
||||
return Boolean.parseBoolean(System.getProperty(WRITE_LOGS_PROP));
|
||||
|
|
|
@ -111,6 +111,11 @@ public class SentryErrorHandler implements ErrorHandler {
|
|||
|
||||
private static void fillScope(ErrorEvent ee, IScope s) {
|
||||
if (ee.isShouldSendDiagnostics()) {
|
||||
// Write all buffered output to log files to ensure that we get all information
|
||||
if (AppLogs.get() != null) {
|
||||
AppLogs.get().flush();
|
||||
}
|
||||
|
||||
var atts = ee.getAttachments().stream()
|
||||
.map(d -> {
|
||||
try {
|
||||
|
|
Loading…
Reference in a new issue