happy-kitchen-89482
06/19/2019, 3:18 PMstrong-caravan-64652
06/19/2019, 4:28 PMscala_library(
name = 'scala_library',
sources = globs('*.scala'),
dependencies = [
'3rdparty/jvm/com/twitter:finagle-http',
'3rdparty/jvm/com/twitter:twitter-util',
'3rdparty/jvm/io/circe',
'3rdparty/jvm/io/finch',
'3rdparty/jvm/org/sangria-graphql',
'3rdparty/jvm/org/typelevel:cats',
'src/jvm/com/thesigma/circe/lib',
'src/jvm/com/thesigma/common/scala',
'src/jvm/com/thesigma/config',
'src/jvm/com/thesigma/effect/core',
'src/jvm/com/thesigma/effect/enriched',
'src/jvm/com/thesigma/encryptedtoken/service',
'src/jvm/com/thesigma/redis/service',
'src/jvm/com/thesigma/server/bag',
'src/jvm/com/thesigma/server/base',
'src/jvm/com/thesigma/server/finch',
'src/jvm/com/thesigma/server/graphql/context',
'src/jvm/com/thesigma/server/graphql/exception',
'src/jvm/com/thesigma/server/graphql/executor',
'src/jvm/com/thesigma/server/graphql/schema/main',
'src/jvm/com/thesigma/tracing/context',
'src/jvm/com/thesigma/user/login/service',
'src/jvm/com/thesigma/validate',
'src/resources/com/thesigma/html',
'src/resources/com/thesigma/logback',
'src/thrift/com/thesigma/encryptedtoken',
'src/thrift/com/thesigma/ids',
],
)
jvm_binary(
name = 'bin',
dependencies = [
':scala_library',
'src/resources/com/thesigma/logback',
],
main = 'com.thesigma.server.graphql.bin.GraphQlServer',
basename = 'graphqlserver',
deploy_jar_rules=jar_rules(rules=[
Duplicate('^BUILD', Duplicate.SKIP),
Duplicate('^META-INF/ASL2.0', Duplicate.SKIP),
Duplicate('^META-INF/INDEX.LIST', Duplicate.SKIP),
Duplicate('^META-INF/io.netty.versions.properties', Duplicate.SKIP),
Duplicate('^rootdoc.txt', Duplicate.SKIP),
]),
)
strong-caravan-64652
06/19/2019, 4:29 PM# Copyright 2019 Merit International, Inc. All Rights Reserved.
resources(
name = 'logback',
sources = rglobs('*.xml'),
)
strong-caravan-64652
06/19/2019, 4:29 PMhappy-kitchen-89482
06/19/2019, 4:31 PMsrc/resources/com/thesigma/logback/BUILD
?strong-caravan-64652
06/19/2019, 4:31 PMhappy-kitchen-89482
06/19/2019, 4:33 PMlogback.xml
in the com.thesigma.logback
package?strong-caravan-64652
06/19/2019, 4:34 PMlogback.xml
anywhere on the classpath. Not sure if the package comes into playstrong-caravan-64652
06/19/2019, 4:34 PMLet us begin by discussing the initialization steps that logback follows to try to configure itself:
Logback tries to find a file called logback-test.xml in the classpath.
If no such file is found, logback tries to find a file called logback.groovy in the classpath.
If no such file is found, it checks for the file logback.xml in the classpath..
If no such file is found, service-provider loading facility (introduced in JDK 1.6) is used to resolve the implementation of com.qos.logback.classic.spi.Configurator interface by looking up the file META-INF\services\ch.qos.logback.classic.spi.Configurator in the class path. Its contents should specify the fully qualified class name of the desired Configurator implementation.
If none of the above succeeds, logback configures itself automatically using the BasicConfigurator which will cause logging output to be directed to the console.
https://logback.qos.ch/manual/configuration.htmlhappy-kitchen-89482
06/19/2019, 4:38 PMhappy-kitchen-89482
06/19/2019, 4:38 PMjar -t
the jarfile and see where that logback.xml file is?happy-kitchen-89482
06/19/2019, 4:39 PMjar -t <jarfile> | grep logback.xml
strong-caravan-64652
06/19/2019, 4:42 PMcom/thesigma/logback/logback.xml
happy-kitchen-89482
06/19/2019, 4:43 PMhappy-kitchen-89482
06/19/2019, 4:43 PMlogback.xml
in the root of the package hierarchystrong-caravan-64652
06/19/2019, 4:43 PMhappy-kitchen-89482
06/19/2019, 4:44 PMhappy-kitchen-89482
06/19/2019, 4:44 PMpants.ini
, but I don't think that's the right call herestrong-caravan-64652
06/19/2019, 4:44 PMsrc/jvm
, I should just put it in there?happy-kitchen-89482
06/19/2019, 4:45 PMlogback.xml
directly under src/resources
(or src/jvm
), so that the structure in your source tree accurately reflects what will happen in the JAR file.happy-kitchen-89482
06/19/2019, 4:45 PMresources()
target in src/jvm/BUILD
happy-kitchen-89482
06/19/2019, 4:45 PMsrc/resources/BUILD
happy-kitchen-89482
06/19/2019, 4:46 PMsrc/resources/com/thesigma/logback
a source root, but that seems perverse.strong-caravan-64652
06/19/2019, 4:47 PMsrc/resources
, I think the team will like that better than dropping it in src/jvm
strong-caravan-64652
06/19/2019, 4:48 PMstrong-caravan-64652
06/19/2019, 4:53 PMhappy-kitchen-89482
06/19/2019, 4:53 PM