Skip to content

Commit

Permalink
fix: Prompt logs are not saved for RouteController #611 (#614)
Browse files Browse the repository at this point in the history
  • Loading branch information
astsiapanay authored Dec 12, 2024
1 parent e71063f commit a349c24
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.epam.aidial.core.server.log;

import com.epam.aidial.core.config.Deployment;
import com.epam.aidial.core.config.Upstream;
import com.epam.aidial.core.server.Proxy;
import com.epam.aidial.core.server.ProxyContext;
Expand Down Expand Up @@ -114,9 +115,12 @@ private void append(ProxyContext context, LogEntry entry, String assembledStream
append(entry, "}", false);
}

append(entry, ",\"deployment\":\"", false);
append(entry, context.getDeployment().getName(), true);
append(entry, "\"", false);
Deployment deployment = context.getDeployment();
if (deployment != null) {
append(entry, ",\"deployment\":\"", false);
append(entry, deployment.getName(), true);
append(entry, "\"", false);
}

String parentDeployment = getParentDeployment(context);
if (parentDeployment != null) {
Expand Down Expand Up @@ -359,6 +363,9 @@ static String getParentDeployment(ProxyContext context) {
}
// skip interceptors and return the deployment which called the current one
List<String> executionPath = context.getExecutionPath();
if (executionPath == null) {
return null;
}
int i = executionPath.size() - 2;
for (int j = interceptors.size() - 1; i >= 0 && j >= 0; i--, j--) {
String deployment = executionPath.get(i);
Expand Down

0 comments on commit a349c24

Please sign in to comment.