提交 b1f4bf31 编写于 作者: P proller

CLICKHOUSE-3587 Always write client error to log

上级 ead94937
......@@ -109,26 +109,24 @@ static void onExceptionBeforeStart(const String & query, Context & context, time
bool log_queries = context.getSettingsRef().log_queries;
/// Log the start of query execution into the table if necessary.
if (log_queries)
{
QueryLogElement elem;
QueryLogElement elem;
elem.type = QueryLogElement::EXCEPTION_BEFORE_START;
elem.type = QueryLogElement::EXCEPTION_BEFORE_START;
elem.event_time = current_time;
elem.query_start_time = current_time;
elem.event_time = current_time;
elem.query_start_time = current_time;
elem.query = query.substr(0, context.getSettingsRef().log_queries_cut_to_length);
elem.exception = getCurrentExceptionMessage(false);
elem.query = query.substr(0, context.getSettingsRef().log_queries_cut_to_length);
elem.exception = getCurrentExceptionMessage(false);
elem.client_info = context.getClientInfo();
elem.client_info = context.getClientInfo();
setExceptionStackTrace(elem);
logException(context, elem);
setExceptionStackTrace(elem);
logException(context, elem);
if (log_queries)
if (auto query_log = context.getQueryLog())
query_log->add(elem);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册