Skip to content

Commit 07d6655

Browse files
authored
Use AddAfterFatalCallback to flush yt log (#11214)
1 parent c1c873a commit 07d6655

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

ydb/library/yql/providers/yt/lib/log/ya.make

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ PEERDIR(
99
ydb/library/yql/providers/yt/lib/init_yt_api
1010
yt/cpp/mapreduce/interface/logging
1111
ydb/library/yql/utils/log
12+
ydb/library/yql/utils/backtrace
1213
)
1314

1415
END()

ydb/library/yql/providers/yt/lib/log/yt_logger.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
#include "yt_logger.h"
2+
13
#include <ydb/library/yql/providers/yt/lib/init_yt_api/init.h>
24

35
#include <ydb/library/yql/utils/log/log.h>
6+
#include <ydb/library/yql/utils/backtrace/backtrace.h>
47

58
#include <yt/cpp/mapreduce/interface/logging/logger.h>
69

@@ -130,6 +133,7 @@ void SetYtLoggerGlobalBackend(int level, size_t debugLogBufferSize, const TStrin
130133
InitYtApiOnce();
131134
if (level >= 0 || (debugLogBufferSize && debugLogFile)) {
132135
NYT::SetLogger(new TGlobalLoggerImpl(level, debugLogBufferSize, debugLogFile, debugLogAlwaysWrite));
136+
NYql::NBacktrace::AddAfterFatalCallback([](int ){ NYql::FlushYtDebugLog(); });
133137
} else {
134138
NYT::SetLogger(NYT::ILoggerPtr());
135139
}

0 commit comments

Comments
 (0)