fix bug missing system logs in ksuto (#593)
This commit is contained in:
Родитель
8e8b53fb1a
Коммит
c4d4c338a6
|
@ -69,6 +69,7 @@ public class WorkerLogManager {
|
|||
private boolean logToConsole;
|
||||
private final Logger emptyLogger, systemLogger, hostLogger;
|
||||
private final static WorkerLogManager INSTANCE = new WorkerLogManager();
|
||||
public final static String SYSTEM_LOG_PREFIX = "azure_functions_java_worker";
|
||||
}
|
||||
|
||||
class SystemLoggerListener extends Handler {
|
||||
|
|
|
@ -18,6 +18,18 @@ public class RpcLogHandler extends OutboundMessageHandler<RpcLog.Builder> {
|
|||
|
||||
private static RpcLog.Builder generateRpcLog(LogRecord record, String invocationId) {
|
||||
RpcLog.Builder log = RpcLog.newBuilder();
|
||||
/**
|
||||
* Check if the logging namespace belongs to system logsq, invocation log should be categorized to user type (default), others should
|
||||
* be categorized to system type.
|
||||
*
|
||||
* local_console customer_app_insight functions_kusto_table
|
||||
* system_log false, false, true
|
||||
* user_log true, true, false
|
||||
*/
|
||||
if (invocationId == null){
|
||||
log.setLogCategory(RpcLog.RpcLogCategory.System);
|
||||
log.setCategory(WorkerLogManager.SYSTEM_LOG_PREFIX);
|
||||
}
|
||||
Optional.ofNullable(invocationId).ifPresent(log::setInvocationId);
|
||||
Optional.ofNullable(record.getLoggerName()).ifPresent(log::setCategory);
|
||||
Optional.ofNullable(mapLogLevel(record.getLevel())).ifPresent(log::setLevel);
|
||||
|
|
Загрузка…
Ссылка в новой задаче