Adding logs for easier debugging (#615)
This commit is contained in:
Родитель
8b2a459a52
Коммит
4672549ef7
|
@ -7,4 +7,8 @@ public class Util {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static String getJavaVersion() {
|
||||
return String.join(" - ", System.getProperty("java.home"), System.getProperty("java.version"));
|
||||
}
|
||||
}
|
|
@ -25,6 +25,7 @@ public class FunctionEnvironmentReloadRequestHandler
|
|||
|
||||
@Override
|
||||
String execute(FunctionEnvironmentReloadRequest request, Builder response) throws Exception {
|
||||
WorkerLogManager.getSystemLogger().log(Level.INFO, "FunctionEnvironmentReloadRequest received by the Java worker");
|
||||
EnvironmentVariables = request.getEnvironmentVariablesMap();
|
||||
if (EnvironmentVariables == null || EnvironmentVariables.isEmpty()) {
|
||||
return String
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package com.microsoft.azure.functions.worker.handler;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import com.microsoft.azure.functions.worker.WorkerLogManager;
|
||||
import com.microsoft.azure.functions.worker.broker.*;
|
||||
import com.microsoft.azure.functions.worker.description.*;
|
||||
import com.microsoft.azure.functions.rpc.messages.*;
|
||||
|
@ -18,6 +20,7 @@ public class FunctionLoadRequestHandler extends MessageHandler<FunctionLoadReque
|
|||
|
||||
@Override
|
||||
String execute(FunctionLoadRequest request, FunctionLoadResponse.Builder response) throws Exception {
|
||||
WorkerLogManager.getSystemLogger().log(Level.INFO, "FunctionLoadRequest received by the Java worker");
|
||||
final RpcFunctionMetadata metadata = request.getMetadata();
|
||||
final FunctionMethodDescriptor descriptor = createFunctionDescriptor(request.getFunctionId(), metadata);
|
||||
|
||||
|
|
|
@ -7,6 +7,8 @@ import com.microsoft.azure.functions.worker.*;
|
|||
import com.microsoft.azure.functions.worker.broker.*;
|
||||
import com.microsoft.azure.functions.rpc.messages.*;
|
||||
|
||||
import static com.microsoft.azure.functions.worker.Util.getJavaVersion;
|
||||
|
||||
public class InvocationRequestHandler extends MessageHandler<InvocationRequest, InvocationResponse.Builder> {
|
||||
public InvocationRequestHandler(JavaFunctionBroker broker) {
|
||||
super(StreamingMessage::getInvocationRequest,
|
||||
|
@ -23,6 +25,8 @@ public class InvocationRequestHandler extends MessageHandler<InvocationRequest,
|
|||
|
||||
@Override
|
||||
String execute(InvocationRequest request, InvocationResponse.Builder response) throws Exception {
|
||||
WorkerLogManager.getSystemLogger().log(Level.INFO, "Java version - " + getJavaVersion());
|
||||
WorkerLogManager.getSystemLogger().log(Level.INFO, "InvocationRequest received by the Java worker");
|
||||
final String functionId = request.getFunctionId();
|
||||
final String invocationId = request.getInvocationId();
|
||||
|
||||
|
|
|
@ -4,6 +4,8 @@ import com.microsoft.azure.functions.worker.*;
|
|||
import com.microsoft.azure.functions.rpc.messages.*;
|
||||
import com.microsoft.azure.functions.worker.broker.JavaFunctionBroker;
|
||||
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class WorkerInitRequestHandler extends MessageHandler<WorkerInitRequest, WorkerInitResponse.Builder> {
|
||||
public WorkerInitRequestHandler(JavaFunctionBroker broker) {
|
||||
super(StreamingMessage::getWorkerInitRequest,
|
||||
|
@ -15,6 +17,7 @@ public class WorkerInitRequestHandler extends MessageHandler<WorkerInitRequest,
|
|||
|
||||
@Override
|
||||
String execute(WorkerInitRequest request, WorkerInitResponse.Builder response) {
|
||||
WorkerLogManager.getSystemLogger().log(Level.INFO, "WorkerInitRequest received by the Java worker");
|
||||
broker.setWorkerDirectory(request.getWorkerDirectory());
|
||||
response.setWorkerVersion(Application.version());
|
||||
response.putCapabilities("TypedDataCollection", "TypedDataCollection");
|
||||
|
|
Загрузка…
Ссылка в новой задаче