Skip to content

Commit

Permalink
[serving] Avoid compile time dependency on log4j (deepjavalibrary#603)
Browse files Browse the repository at this point in the history
  • Loading branch information
frankfliu authored Apr 5, 2023
1 parent 916b851 commit e1a096f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ commons_cli_version=1.5.0
netty_version=4.1.87.Final
slf4j_version=1.7.36
log4j_slf4j_version=2.19.0
snakeyaml_version=1.33
snakeyaml_version=2.0
disruptor_version=3.4.4
testng_version=7.7.1
5 changes: 3 additions & 2 deletions serving/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ dependencies {

//noinspection GradlePackageUpdate
implementation "commons-cli:commons-cli:${commons_cli_version}"
implementation "org.apache.logging.log4j:log4j-slf4j-impl:${log4j_slf4j_version}"
implementation "com.lmax:disruptor:${disruptor_version}"

runtimeOnly "org.apache.logging.log4j:log4j-slf4j-impl:${log4j_slf4j_version}"
runtimeOnly "com.lmax:disruptor:${disruptor_version}"

runtimeOnly "ai.djl:model-zoo"
runtimeOnly "ai.djl.mxnet:mxnet-model-zoo"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
import io.netty.handler.codec.http.QueryStringDecoder;
import io.netty.util.CharsetUtil;

import org.apache.logging.log4j.util.Strings;

import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
Expand Down Expand Up @@ -337,7 +335,7 @@ private void handleScaleWorkflow(
}
}

String combinedMsg = Strings.join(messages, '\n');
String combinedMsg = String.join("\n", messages);
NettyUtils.sendJsonResponse(ctx, new StatusResponse(combinedMsg));
} catch (NumberFormatException ex) {
throw new BadRequestException("parameter is invalid number." + ex.getMessage(), ex);
Expand Down

0 comments on commit e1a096f

Please sign in to comment.