Skip to content

Commit

Permalink
Unify semantic test between sandbox IT and Ledger API Test Tool (digi…
Browse files Browse the repository at this point in the history
…tal-asset#1171)

* Add RemoteApiProxy fixture type.

This is in preparation for using Sandbox IT suite as part of the Ledger API Test
Tool.

* ledger-api-test-tool: Drop reset functionality.

This is no longer necessary for the tool and it does not scale with the types of
tests in the suite.

* integration-tests: Fail if the server under fixture is stuck.

This makes sure that a server getting stuck will get detected by a test, instead
of ignoring it and potentially allowing the server to linger.

* integration-test: Make semantic testing runs independent.

It manges parties and command identifier to include a unique (random) suffix in
all ledger-commited identifiers. This allows the test to run against a Ledger
API without reseting it.

* ledger-api-test-tool: Unify test code using scenario runner with IT suite.

This reuses the scenario runner test code from the IT suite, instead of
reimplementing it. This should be a no-op (except for tests reports formatting).

* Review fixes.

* Ledger API Test Tool: Provide logback config.

This quites Ledger API Test Tool output.

* Make sure akka threads are terminated at end of test runs.

This makrs Akka threads to be daemons, hence forcing them to be closed at the
end of Ledger Api Test Tool.

* Use Ledger API Test Tool in tests of reference server.

* Add Apache commons-lang3.

* Ledger API Test Tool: Implement custom test reporter.

This addresses two needs:
- avoid using buggy scalatest test reporter;
- pretty-prints test results prettier.

* dade-copyright-headers: return success on successful reformatting.
  • Loading branch information
gleber-da authored and mergify[bot] committed May 28, 2019
1 parent c1b98f8 commit 40ce2b9
Show file tree
Hide file tree
Showing 23 changed files with 376 additions and 158 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/dependencies.digest
Original file line number Diff line number Diff line change
@@ -1 +1 @@
643a5531d82d832abd2af7322385afa1e8b56449 dependencies.yaml
5261184634cb10d42d80a384e8eed64d8bb8eb05 dependencies.yaml
2 changes: 1 addition & 1 deletion 3rdparty/jvm/org/apache/commons/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ java_library(
"//external:jar/org/apache/commons/commons_lang3"
],
visibility = [
"//3rdparty/jvm:__subpackages__"
"//visibility:public"
]
)

Expand Down
4 changes: 2 additions & 2 deletions 3rdparty/workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,10 @@ def list_dependencies():
{"artifact": "net.java.dev.jna:jna:4.5.0", "lang": "java", "sha1": "55b548d3195efc5280bf1c3f17b49659c54dee40", "sha256": "617a8d75f66a57296255a13654a99f10f72f0964336e352211247ed046da3e94", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/net/java/dev/jna/jna/4.5.0/jna-4.5.0.jar", "source": {"sha1": "81072e8420f1635a3625cdfd253ccea6e33535cc", "sha256": "e4da62978d75a5f47641d6c3548a6859c193fad8c5d0bc95a5f049d8ec1a0f79", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/net/java/dev/jna/jna/4.5.0/jna-4.5.0-sources.jar"} , "name": "net_java_dev_jna_jna", "actual": "@net_java_dev_jna_jna//jar", "bind": "jar/net/java/dev/jna/jna"},
{"artifact": "org.apache.commons:commons-compress:1.12", "lang": "java", "sha1": "84caa68576e345eb5e7ae61a0e5a9229eb100d7b", "sha256": "2c1542faf343185b7cab9c3d55c8ae5471d6d095d3887a4adefdbdf2984dc0b6", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/org/apache/commons/commons-compress/1.12/commons-compress-1.12.jar", "source": {"sha1": "1fdd1a2fed15cdf08780ed564279c0ddbff46419", "sha256": "ae08ac41171c3805f5e8ff04c29a95163a1bf8fb25ccff49581f7af6c902606d", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/org/apache/commons/commons-compress/1.12/commons-compress-1.12-sources.jar"} , "name": "org_apache_commons_commons_compress", "actual": "@org_apache_commons_commons_compress//jar", "bind": "jar/org/apache/commons/commons_compress"},
{"artifact": "org.apache.commons:commons-exec:1.3", "lang": "java", "sha1": "8dfb9facd0830a27b1b5f29f84593f0aeee7773b", "sha256": "cb49812dc1bfb0ea4f20f398bcae1a88c6406e213e67f7524fb10d4f8ad9347b", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/org/apache/commons/commons-exec/1.3/commons-exec-1.3.jar", "source": {"sha1": "efd2543e352e55ce5a685eed6db8af028b737905", "sha256": "c121d8e70010092bafc56f358e7259ac484653db595aafea1e67a040f51aea66", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/org/apache/commons/commons-exec/1.3/commons-exec-1.3-sources.jar"} , "name": "org_apache_commons_commons_exec", "actual": "@org_apache_commons_commons_exec//jar", "bind": "jar/org/apache/commons/commons_exec"},
# duplicates in org.apache.commons:commons-lang3 promoted to 3.7
# duplicates in org.apache.commons:commons-lang3 fixed to 3.9
# - com.storm-enroute:scalameter-core_2.12:0.10.1 wanted version 3.4
# - org.apache.commons:commons-text:1.4 wanted version 3.7
{"artifact": "org.apache.commons:commons-lang3:3.7", "lang": "java", "sha1": "557edd918fd41f9260963583ebf5a61a43a6b423", "sha256": "6e8dc31e046508d9953c96534edf0c2e0bfe6f468966b5b842b3f87e43b6a847", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/org/apache/commons/commons-lang3/3.7/commons-lang3-3.7.jar", "source": {"sha1": "e7e36219edde1c66c93495a75490d8f526c377cb", "sha256": "8c48529d61778cee7b44e1c5858c887abed5395f5d13d6d52931d14ab22f017f", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/org/apache/commons/commons-lang3/3.7/commons-lang3-3.7-sources.jar"} , "name": "org_apache_commons_commons_lang3", "actual": "@org_apache_commons_commons_lang3//jar", "bind": "jar/org/apache/commons/commons_lang3"},
{"artifact": "org.apache.commons:commons-lang3:3.9", "lang": "java", "sha1": "0122c7cee69b53ed4a7681c03d4ee4c0e2765da5", "sha256": "de2e1dcdcf3ef917a8ce858661a06726a9a944f28e33ad7f9e08bea44dc3c230", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/org/apache/commons/commons-lang3/3.9/commons-lang3-3.9.jar", "source": {"sha1": "8f1cb192e229bc4cd1c900c51171d96706e6d195", "sha256": "d97341ce0a7554028db3403e407bb51f4d902bf3287f64f709d7a8156eaf1910", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/org/apache/commons/commons-lang3/3.9/commons-lang3-3.9-sources.jar"} , "name": "org_apache_commons_commons_lang3", "actual": "@org_apache_commons_commons_lang3//jar", "bind": "jar/org/apache/commons/commons_lang3"},
{"artifact": "org.apache.commons:commons-math3:3.2", "lang": "java", "sha1": "ec2544ab27e110d2d431bdad7d538ed509b21e62", "sha256": "6268a9a0ea3e769fc493a21446664c0ef668e48c93d126791f6f3f757978fee2", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/org/apache/commons/commons-math3/3.2/commons-math3-3.2.jar", "source": {"sha1": "cd098e055bf192a60c81d81893893e6e31a6482f", "sha256": "b62d60712ea06fb6259506269b3a0ed73a7da5ee11f891c0eb0399eb9bc71e3f", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/org/apache/commons/commons-math3/3.2/commons-math3-3.2-sources.jar"} , "name": "org_apache_commons_commons_math3", "actual": "@org_apache_commons_commons_math3//jar", "bind": "jar/org/apache/commons/commons_math3"},
{"artifact": "org.apache.commons:commons-text:1.4", "lang": "java", "sha1": "680b74de9c393bbf8d9e951af301659b16845907", "sha256": "d624e443240a5fccc93edbfe758df1b69c07d7eaab6fc5e8f98f77d86ced8259", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/org/apache/commons/commons-text/1.4/commons-text-1.4.jar", "source": {"sha1": "8f337be1d719810f0f894b0abb6416705af341df", "sha256": "00d006377bbe1667b8fdaa5bb3da35137c0d3bc28e7426276fcb1f5a50630eb2", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/org/apache/commons/commons-text/1.4/commons-text-1.4-sources.jar"} , "name": "org_apache_commons_commons_text", "actual": "@org_apache_commons_commons_text//jar", "bind": "jar/org/apache/commons/commons_text"},
{"artifact": "org.apache.httpcomponents:httpclient:4.5.3", "lang": "java", "sha1": "d1577ae15f01ef5438c5afc62162457c00a34713", "sha256": "db3d1b6c2d6a5e5ad47577ad61854e2f0e0936199b8e05eb541ed52349263135", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/org/apache/httpcomponents/httpclient/4.5.3/httpclient-4.5.3.jar", "source": {"sha1": "4969730c661fff76fa7f9d4c7c61545817f5b033", "sha256": "6475ea5ce5bce787f88f449c4d29dc8cafbeba9f172683fcad15c2e4b5e2ed84", "repository": "http://central.maven.org/maven2/", "url": "http://central.maven.org/maven2/org/apache/httpcomponents/httpclient/4.5.3/httpclient-4.5.3-sources.jar"} , "name": "org_apache_httpcomponents_httpclient", "actual": "@org_apache_httpcomponents_httpclient//jar", "bind": "jar/org/apache/httpcomponents/httpclient"},
Expand Down
4 changes: 4 additions & 0 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,10 @@ dependencies:
lang: java
version: "1.4"

commons-lang3:
lang: java
version: "3.9"

org.jboss.logging:
jboss-logging:
lang: java
Expand Down
4 changes: 2 additions & 2 deletions dev-env/bin/dade-copyright-headers
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,13 @@ def process_file(filename, check_only):
# no copyright header, prepend it.
fp.write(header + "\n")
fp.write("".join(before_header))
return True
else:
if state == 'fail':
print(f"{filename}s: copyright header out-of-date")
else:
print(f"{filename}: copyright header missing")

return False
return False

#########################
# Main
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,31 @@

package com.digitalasset.ledger.api.testing.utils

import java.util.concurrent.Executors

import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import com.google.common.util.concurrent.ThreadFactoryBuilder
import org.scalatest.{BeforeAndAfterAll, Suite}

import scala.concurrent.Await
import scala.concurrent.{Await, ExecutionContext}
import scala.concurrent.duration._

trait AkkaBeforeAndAfterAll extends BeforeAndAfterAll { self: Suite =>
trait AkkaBeforeAndAfterAll extends BeforeAndAfterAll {
self: Suite =>
protected def actorSystemName = this.getClass.getSimpleName

private val executorContext = ExecutionContext.fromExecutorService(
Executors.newSingleThreadExecutor(
new ThreadFactoryBuilder()
.setDaemon(true)
.setNameFormat(s"${actorSystemName}-thread-pool-worker-%d")
.setUncaughtExceptionHandler((thread, _) =>
println(s"got an uncaught exception on thread: ${thread.getName}"))
.build()))

protected implicit val system: ActorSystem = ActorSystem(this.getClass.getSimpleName)
protected implicit val system: ActorSystem =
ActorSystem(actorSystemName, defaultExecutionContext = Some(executorContext))

protected implicit val materializer: ActorMaterializer = ActorMaterializer()

Expand Down
5 changes: 2 additions & 3 deletions ledger/api-server-damlonx/reference/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,9 @@ da_scala_binary(
)

client_server_test(
name = "semantic-test",
name = "conformance-test",
timeout = "short",
client = "//ledger/ledger-api-integration-tests:semantic-test-runner",
client_args = ["ledger/ledger-api-integration-tests/SemanticTests.dar"],
client = "//ledger/ledger-api-test-tool:ledger-api-test-tool",
data = [
"//ledger/ledger-api-integration-tests:SemanticTests.dar",
],
Expand Down
17 changes: 16 additions & 1 deletion ledger/ledger-api-integration-tests/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,24 @@ java_library(
],
)

da_scala_library(
name = "ledger-api-integration-tests-as-library",
srcs = glob([
"src/test/itsuite/**/*.scala",
"src/test/semanticsuite/**/*.scala",
]),
visibility = [
"//ledger/ledger-api-test-tool:__subpackages__",
],
deps = [
":ledger-api-integration-tests-lib",
"//daml-lf/testing-tools",
] + dependencies,
)

da_scala_test_suite(
name = "ledger-api-integration-tests",
size = "large",
srcs = glob(["src/test/itsuite/**/*.scala"]),
data = [
"//ledger/sandbox:Test.dar",
],
Expand All @@ -84,6 +98,7 @@ da_scala_test_suite(
],
deps = [
":default-it-logback-config",
":ledger-api-integration-tests-as-library",
":ledger-api-integration-tests-lib",
] + dependencies,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import java.nio.file.Path
import java.time.Duration

import com.digitalasset.daml.lf.data.Ref
import com.digitalasset.ledger.api.tls.TlsConfiguration
import com.digitalasset.platform.common.LedgerIdMode
import com.digitalasset.platform.sandbox.config.{
CommandConfiguration,
Expand Down Expand Up @@ -41,7 +42,8 @@ object PlatformApplications {
heartBeatInterval: FiniteDuration = 5.seconds,
persistenceEnabled: Boolean = false,
maxNumberOfAcsContracts: Option[Int] = None,
commandConfiguration: CommandConfiguration = SandboxConfig.defaultCommandConfig) {
commandConfiguration: CommandConfiguration = SandboxConfig.defaultCommandConfig,
remoteApiEndpoint: Option[RemoteApiEndpoint] = None) {
require(
Duration.ofSeconds(timeModel.minTtl.getSeconds) == timeModel.minTtl &&
Duration.ofSeconds(timeModel.maxTtl.getSeconds) == timeModel.maxTtl,
Expand Down Expand Up @@ -77,6 +79,22 @@ object PlatformApplications {
def withMaxNumberOfAcsContracts(cap: Int) = copy(maxNumberOfAcsContracts = Some(cap))

def withCommandConfiguration(cc: CommandConfiguration) = copy(commandConfiguration = cc)

def withRemoteApiEndpoint(endpoint: RemoteApiEndpoint) =
copy(remoteApiEndpoint = Some(endpoint))
}

final case class RemoteApiEndpoint(
host: String,
port: Integer,
tlsConfig: Option[TlsConfiguration]) {
def withHost(host: String) = copy(host = host)
def withPort(port: Int) = copy(port = port)
def withTlsConfig(tlsConfig: Option[TlsConfiguration]) = copy(tlsConfig = tlsConfig)
}

object RemoteApiEndpoint {
def default: RemoteApiEndpoint = RemoteApiEndpoint("localhost", 6865, None)
}

object Config {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,19 @@ object LedgerFactories {

}

def createRemoteApiProxyResource(config: PlatformApplications.Config)(
implicit esf: ExecutionSequencerFactory): Resource[LedgerContext.SingleChannelContext] = {
require(config.remoteApiEndpoint.isDefined, "config.remoteApiEndpoint has to be set")
val endpoint = config.remoteApiEndpoint.get
val packageIds = config.darFiles.map(getPackageIdOrThrow)

RemoteServerResource(endpoint.host, endpoint.port, endpoint.tlsConfig)
.map {
case PlatformChannels(channel) =>
LedgerContext.SingleChannelContext(channel, config.ledgerId, packageIds)
}
}

def createSandboxResource(config: PlatformApplications.Config, store: SandboxStore = InMemory)(
implicit esf: ExecutionSequencerFactory): Resource[LedgerContext.SingleChannelContext] = {
val packageIds = config.darFiles.map(getPackageIdOrThrow)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ trait MultiLedgerFixture
LedgerFactories.createSandboxResource(config, SandboxStore.InMemory)
case LedgerBackend.SandboxSql =>
LedgerFactories.createSandboxResource(config, SandboxStore.Postgres)
case LedgerBackend.RemoteApiProxy =>
LedgerFactories.createRemoteApiProxyResource(config)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,21 @@ class RemoteServerResource(host: String, port: Int, tlsConfig: Option[TlsConfigu

}

def createEventLoopGroup(threadPoolName: String): NioEventLoopGroup = {
private def createEventLoopGroup(threadPoolName: String): NioEventLoopGroup = {
val threadFactory = new DefaultThreadFactory(s"$threadPoolName-grpc-eventloop", true)
val parallelism = Runtime.getRuntime.availableProcessors
new NioEventLoopGroup(parallelism, threadFactory)
}

override def close(): Unit = {
channel.shutdownNow()
channel.awaitTermination(1L, TimeUnit.SECONDS)
eventLoopGroup
.shutdownGracefully(0, 0, TimeUnit.SECONDS)
.await(10L, TimeUnit.SECONDS)
if (!channel.awaitTermination(1L, TimeUnit.SECONDS)) {
sys.error(
"Unable to shutdown channel to a remote API under tests. Unable to recover. Terminating.")
}
if (!eventLoopGroup.shutdownGracefully(0, 0, TimeUnit.SECONDS).await(10L, TimeUnit.SECONDS)) {
sys.error("Unable to shutdown event loop. Unable to recover. Terminating.")
}
channel = null
eventLoopGroup = null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,13 @@ class SandboxServerResource(sandboxConfig: SandboxConfig) extends Resource[Platf

override def close(): Unit = {
channel.shutdownNow()
channel.awaitTermination(5L, TimeUnit.SECONDS)
eventLoopGroup
.shutdownGracefully(0, 0, TimeUnit.SECONDS)
.await(10L, TimeUnit.SECONDS)
if (!channel.awaitTermination(5L, TimeUnit.SECONDS)) {
sys.error(
"Unable to shutdown channel to a remote API under tests. Unable to recover. Terminating.")
}
if (!eventLoopGroup.shutdownGracefully(0, 0, TimeUnit.SECONDS).await(10L, TimeUnit.SECONDS)) {
sys.error("Unable to shutdown event loop. Unable to recover. Terminating.")
}
sandboxServer.close()
channel = null
eventLoopGroup = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,64 +3,71 @@

package com.digitalasset.platform.semantictest

import java.io.{BufferedInputStream, File, FileInputStream}
import java.io._

import com.digitalasset.daml.lf.UniversalArchiveReader
import com.digitalasset.daml.lf.data.Ref.PackageId
import com.digitalasset.daml.lf.data.Ref.QualifiedName
import com.digitalasset.daml.lf.engine.testing.SemanticTester
import com.digitalasset.daml.lf.lfpackage.{Ast, Decode}
import com.digitalasset.daml.lf.types.{Ledger => L}
import com.digitalasset.daml.lf.lfpackage.Decode
import com.digitalasset.ledger.api.testing.utils.{
AkkaBeforeAndAfterAll,
SuiteResourceManagementAroundAll
}
import com.digitalasset.platform.apitesting.MultiLedgerFixture
import com.digitalasset.platform.services.time.TimeProviderType
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.{AsyncWordSpec, Matchers}

import scala.util.Random

class SandboxSemanticTestsLfRunner
extends AsyncWordSpec
with Matchers
with MultiLedgerFixture
with SuiteResourceManagementAroundAll
with ScalaFutures
with AkkaBeforeAndAfterAll {

private val darFile = new File("ledger/ledger-api-integration-tests/SemanticTests.dar")
private val defaultDarFile = new File("ledger/ledger-api-integration-tests/SemanticTests.dar")

override protected lazy val config: Config = Config.default
.withDarFile(darFile.toPath)
.withTimeProvider(TimeProviderType.StaticAllowBackwards)
override protected def config: Config =
Config.default
.withDarFile(defaultDarFile.toPath)
.withTimeProvider(TimeProviderType.StaticAllowBackwards)

lazy val (mainPkgId, packages) = {
val dar = UniversalArchiveReader().readFile(darFile).get
lazy val (mainPkgId, packages, darFile) = {
val df = config.darFiles.head.toFile
val dar = UniversalArchiveReader().readFile(df).get
val packages = Map(dar.all.map {
case (pkgId, archive) => Decode.readArchivePayloadAndVersion(pkgId, archive)._1
}: _*)
(dar.main._1, packages)
(dar.main._1, packages, df)
}

s"sandbox launched with $darFile" should {
s"a ledger launched with $darFile" should {
val runSuffix = "-" + Random.alphanumeric.take(10).mkString
val partyNameMangler =
(partyText: String) => partyText + runSuffix + Random.alphanumeric.take(10).mkString
val commandIdMangler: ((QualifiedName, Int, L.ScenarioNodeId) => String) =
(scenario, stepId, nodeId) => {
s"ledger-api-test-tool-$scenario-$stepId-$nodeId-$runSuffix"
}
for {
(pkgId, names) <- SemanticTester.scenarios(Map(mainPkgId -> packages(mainPkgId))) // we only care about the main pkg
name <- names
} {
s"run scenario: $name" in allFixtures { ledger =>
for {
_ <- ledger.reset()
_ <- new SemanticTester(
parties => new SemanticTestAdapter(ledger, packages, parties),
pkgId,
packages)
packages,
partyNameMangler,
commandIdMangler)
.testScenario(name)
} yield succeed
}
}
}
private def readPackage(f: File): (PackageId, Ast.Package) = {
val is = new BufferedInputStream(new FileInputStream(f))
try {
Decode.decodeArchiveFromInputStream(is)
} finally {
is.close()
}
}
}
5 changes: 5 additions & 0 deletions ledger/ledger-api-test-tool/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ da_scala_binary(
]),
main_class = "com.daml.ledger.api.testtool.LedgerApiTestTool",
resources = [
"src/main/resources/logback.xml",
"//ledger/ledger-api-integration-tests:SemanticTests.dar",
],
tags = [
Expand All @@ -70,9 +71,13 @@ da_scala_binary(
# POM file are set correctly.
"fat_jar",
],
visibility = ["//visibility:public"],
deps = dependencies + [
"//ledger/ledger-api-integration-tests:ledger-api-integration-tests-lib",
"//ledger/ledger-api-integration-tests:ledger-api-integration-tests-as-library",
"//ledger/test-common:test-common",
"//daml-lf/testing-tools",
"//3rdparty/jvm/org/apache/commons:commons_lang3",
],
)

Expand Down
23 changes: 23 additions & 0 deletions ledger/ledger-api-test-tool/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="stderr-appender" class="ch.qos.logback.core.ConsoleAppender">
<target>System.err</target>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>trace</level>
</filter>
<encoder>
<pattern>%d{HH:mm:ss.SSS} %highlight(%-5level) %cyan(%logger{5}@[%-4.30thread]) - %msg%n</pattern>
</encoder>
</appender>

<root level="${LOGLEVEL:-INFO}">
<appender-ref ref="stderr-appender"/>
</root>

<logger name="io.netty" level="WARN">
<appender-ref ref="stderr-appender"/>
</logger>
<logger name="io.grpc.netty" level="WARN">
<appender-ref ref="stderr-appender"/>
</logger>
</configuration>
Loading

0 comments on commit 40ce2b9

Please sign in to comment.