Configure logging (#10)
This commit is contained in:
@@ -12,6 +12,6 @@ EXPOSE 8080
|
||||
WORKDIR /app/conduit-server
|
||||
|
||||
COPY --from=build /code/conduit-server/build/distributions/*.tar conduit-server.tar
|
||||
RUN tar xvf conduit-server.tar --strip-components=1
|
||||
RUN tar xf conduit-server.tar --strip-components=1
|
||||
|
||||
CMD bin/conduit-server
|
||||
|
||||
12
build.gradle
12
build.gradle
@@ -18,6 +18,18 @@ subprojects {
|
||||
dependencies {
|
||||
implementation group: 'com.google.guava', name: 'guava', version: '29.0-jre'
|
||||
|
||||
implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.30'
|
||||
|
||||
// SLF4J as a facade over Log4j2 required dependencies
|
||||
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.11.0'
|
||||
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.0'
|
||||
implementation group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.11.0'
|
||||
|
||||
// Bridges from other logging implementations to SLF4J
|
||||
implementation group: 'org.slf4j', name: 'jul-to-slf4j', version: '1.7.30' // JUL bridge
|
||||
implementation group: 'org.slf4j', name: 'jcl-over-slf4j', version: '1.7.30' //JCL bridge
|
||||
implementation group: 'org.slf4j', name: 'log4j-over-slf4j', version: '1.7.30' // log4j1.2 bridge
|
||||
|
||||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.4.2'
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.4.2'
|
||||
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.4.6'
|
||||
|
||||
21
conduit-commons/src/main/resources/log4j2.xml
Normal file
21
conduit-commons/src/main/resources/log4j2.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Configuration status="INFO">
|
||||
|
||||
<Appenders>
|
||||
<Console name="Console" target="SYSTEM_OUT">
|
||||
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n"/>
|
||||
</Console>
|
||||
</Appenders>
|
||||
|
||||
<Loggers>
|
||||
<Root level="TRACE">
|
||||
<AppenderRef ref="Console"/>
|
||||
</Root>
|
||||
|
||||
<Logger name="org.eclipse.jetty" level="INFO" additivity="false">
|
||||
<AppenderRef ref="Console"/>
|
||||
</Logger>
|
||||
|
||||
</Loggers>
|
||||
|
||||
</Configuration>
|
||||
@@ -12,6 +12,7 @@ dependencies {
|
||||
implementation group: 'org.glassfish.jersey.media', name: 'jersey-media-json-jackson', version: '2.31'
|
||||
|
||||
implementation project(':conduit-api')
|
||||
implementation project(':conduit-commons')
|
||||
}
|
||||
|
||||
application {
|
||||
|
||||
@@ -6,8 +6,11 @@ import org.eclipse.jetty.servlet.ServletContextHandler;
|
||||
import org.eclipse.jetty.servlet.ServletHolder;
|
||||
import org.glassfish.jersey.server.ResourceConfig;
|
||||
import org.glassfish.jersey.servlet.ServletContainer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class ServerApp {
|
||||
private final static Logger LOGGER = LoggerFactory.getLogger(ServerApp.class);
|
||||
|
||||
public ServerApp() {
|
||||
}
|
||||
@@ -31,7 +34,7 @@ public class ServerApp {
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
System.out.println("Starting Server...");
|
||||
LOGGER.info("Starting server...");
|
||||
|
||||
new ServerApp().start();
|
||||
}
|
||||
|
||||
13
tools/app/build.sh
Executable file
13
tools/app/build.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
set -e
|
||||
|
||||
. tools/lib/lib.sh
|
||||
|
||||
main() {
|
||||
assert_root
|
||||
|
||||
docker build . -t dataline/conduit:$VERSION
|
||||
}
|
||||
|
||||
main "$@"
|
||||
13
tools/app/publish.sh
Executable file
13
tools/app/publish.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
set -e
|
||||
|
||||
. tools/lib/lib.sh
|
||||
|
||||
main() {
|
||||
assert_root
|
||||
|
||||
docker push dataline/conduit:$VERSION
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Reference in New Issue
Block a user