diff --git a/.gitignore b/.gitignore index 549e00a..2e8c18d 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,6 @@ build/ ### VS Code ### .vscode/ + +### Application logs ### +logs/ diff --git a/pom.xml b/pom.xml index ea6349e..dd6f6a2 100644 --- a/pom.xml +++ b/pom.xml @@ -20,6 +20,18 @@ org.springframework.boot spring-boot-starter-web + + + + + org.springframework.boot + spring-boot-starter-logging + + + ch.qos.logback + logback-classic + + @@ -53,6 +65,24 @@ spring-boot-starter-test test + + + + + + + + com.lmax + disruptor + 3.4.2 + + + + + + org.springframework.boot + spring-boot-starter-log4j2 + diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 3e6bdaf..5140075 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -8,3 +8,7 @@ solr.collection=TMF-index-openaire solr.zkHosts=zookeeper-solr-openaire-dev-1:2181,zookeeper-solr-openaire-dev-2:2181,zookeeper-solr-openaire-dev-3:2181 logging.level.org.springframework.web=DEBUG + +#removes 'trace' field from error responses; alternatively remove 'spring-boot-devtools' dependency +server.error.include-stacktrace=never + diff --git a/src/main/resources/log4j2.component.properties b/src/main/resources/log4j2.component.properties new file mode 100644 index 0000000..ee7c907 --- /dev/null +++ b/src/main/resources/log4j2.component.properties @@ -0,0 +1 @@ +Log4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml new file mode 100644 index 0000000..a25c665 --- /dev/null +++ b/src/main/resources/log4j2.xml @@ -0,0 +1,43 @@ + + + + logs/ + api.log + ${logpath-location}/archive/api + 10 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file