diff --git a/inception/inception-app-webapp/src/main/resources/log4j2.xml b/inception/inception-app-webapp/src/main/resources/log4j2-spring.xml similarity index 98% rename from inception/inception-app-webapp/src/main/resources/log4j2.xml rename to inception/inception-app-webapp/src/main/resources/log4j2-spring.xml index 3c8c3a5796c..41794ee3295 100644 --- a/inception/inception-app-webapp/src/main/resources/log4j2.xml +++ b/inception/inception-app-webapp/src/main/resources/log4j2-spring.xml @@ -1,5 +1,5 @@ - + %d{yyyy-MM-dd HH:mm:ss} %level{length=5} [%encode{$${ctx:username:-SYSTEM}}{CRLF}] %logger{1} - %encode{%msg}{CRLF}%n diff --git a/inception/inception-doc/src/main/resources/META-INF/asciidoc/admin-guide/logging.adoc b/inception/inception-doc/src/main/resources/META-INF/asciidoc/admin-guide/logging.adoc index d7c99beda72..e81f1f2a4d7 100644 --- a/inception/inception-doc/src/main/resources/META-INF/asciidoc/admin-guide/logging.adoc +++ b/inception/inception-doc/src/main/resources/META-INF/asciidoc/admin-guide/logging.adoc @@ -39,7 +39,7 @@ logging.level.de.tudarmstadt.ukp.inception.security=TRACE == Custom logging A custom logging configuration can be specified when starting up {product-name} using the parameter -`-Dlog4j.configurationFile=/path/to/your/log4.xml`. This should be a standard Log4J configuration file. +`-Dlogging.config=/path/to/your/log4.xml`. This should be a standard Log4J2 configuration file. A good starting point is the default configuration used by {product-name} which can be found in link:https://github.com/inception-project/inception/blob/main/inception/inception-app-webapp/src/main/resources/log4j2.xml[our code repository]. == Logging in JSON format @@ -47,7 +47,7 @@ A good starting point is the default configuration used by {product-name} which If you would like to integrate the logging output of {product-name} with something like LogStash and Kibana, you may want log output to be in a properly interpretable JSON format, instead of the usual plain text format. {product-name} comes with several JSON configurations that are compatible with -popular tools like LogStash and others. You can activate it by adding the following sections to a custom `log4j.xml` file in the `Appenders` sections and in the `Root` logger. +popular tools like LogStash and others. You can activate it by adding the following sections to a custom `log4j2.xml` file in the `Appenders` sections and in the `Root` logger. [source,text] ---- diff --git a/inception/inception-ui-core/pom.xml b/inception/inception-ui-core/pom.xml index 3090aaf8c3e..497218fd9e2 100644 --- a/inception/inception-ui-core/pom.xml +++ b/inception/inception-ui-core/pom.xml @@ -76,6 +76,10 @@ org.springframework.boot spring-boot + + org.springframework.boot + spring-boot-autoconfigure + diff --git a/inception/inception-ui-core/src/main/java/de/tudarmstadt/ukp/clarin/webanno/ui/core/footer/VersionFooterItem.java b/inception/inception-ui-core/src/main/java/de/tudarmstadt/ukp/clarin/webanno/ui/core/footer/VersionFooterItem.java index ac73bc827ff..4f9730d7ded 100644 --- a/inception/inception-ui-core/src/main/java/de/tudarmstadt/ukp/clarin/webanno/ui/core/footer/VersionFooterItem.java +++ b/inception/inception-ui-core/src/main/java/de/tudarmstadt/ukp/clarin/webanno/ui/core/footer/VersionFooterItem.java @@ -21,7 +21,6 @@ import org.springframework.core.annotation.Order; @Order(FooterItem.ORDER_CENTER) -@org.springframework.stereotype.Component public class VersionFooterItem implements FooterItem { diff --git a/inception/inception-ui-core/src/main/java/de/tudarmstadt/ukp/clarin/webanno/ui/core/footer/WarningsFooterItem.java b/inception/inception-ui-core/src/main/java/de/tudarmstadt/ukp/clarin/webanno/ui/core/footer/WarningsFooterItem.java index dcf95f280d6..924da7589f5 100644 --- a/inception/inception-ui-core/src/main/java/de/tudarmstadt/ukp/clarin/webanno/ui/core/footer/WarningsFooterItem.java +++ b/inception/inception-ui-core/src/main/java/de/tudarmstadt/ukp/clarin/webanno/ui/core/footer/WarningsFooterItem.java @@ -21,7 +21,6 @@ import org.springframework.core.annotation.Order; @Order(FooterItem.ORDER_RIGHT) -@org.springframework.stereotype.Component public class WarningsFooterItem implements FooterItem { diff --git a/inception/inception-ui-core/src/main/java/de/tudarmstadt/ukp/inception/ui/core/about/AboutFooterItem.java b/inception/inception-ui-core/src/main/java/de/tudarmstadt/ukp/inception/ui/core/about/AboutFooterItem.java index 8bd55d6f42c..84249f2d617 100644 --- a/inception/inception-ui-core/src/main/java/de/tudarmstadt/ukp/inception/ui/core/about/AboutFooterItem.java +++ b/inception/inception-ui-core/src/main/java/de/tudarmstadt/ukp/inception/ui/core/about/AboutFooterItem.java @@ -23,7 +23,6 @@ import de.tudarmstadt.ukp.clarin.webanno.ui.core.footer.FooterItem; @Order(FooterItem.ORDER_RIGHT + 100) -@org.springframework.stereotype.Component public class AboutFooterItem implements FooterItem { diff --git a/inception/inception-ui-core/src/main/java/de/tudarmstadt/ukp/inception/ui/core/config/CoreUiAutoConfiguration.java b/inception/inception-ui-core/src/main/java/de/tudarmstadt/ukp/inception/ui/core/config/CoreUiAutoConfiguration.java index 69fde80e2f1..ea006f2c222 100644 --- a/inception/inception-ui-core/src/main/java/de/tudarmstadt/ukp/inception/ui/core/config/CoreUiAutoConfiguration.java +++ b/inception/inception-ui-core/src/main/java/de/tudarmstadt/ukp/inception/ui/core/config/CoreUiAutoConfiguration.java @@ -17,12 +17,35 @@ */ package de.tudarmstadt.ukp.inception.ui.core.config; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import de.tudarmstadt.ukp.clarin.webanno.ui.core.footer.VersionFooterItem; +import de.tudarmstadt.ukp.clarin.webanno.ui.core.footer.WarningsFooterItem; +import de.tudarmstadt.ukp.inception.ui.core.about.AboutFooterItem; + @Configuration @EnableConfigurationProperties(CspPropertiesImpl.class) public class CoreUiAutoConfiguration { - // No beans yet + @ConditionalOnMissingBean(value = VersionFooterItem.class) + @Bean + public VersionFooterItem versionFooterItem() + { + return new VersionFooterItem(); + } + + @Bean + public WarningsFooterItem warningsFooterItem() + { + return new WarningsFooterItem(); + } + + @Bean + public AboutFooterItem aboutFooterItem() + { + return new AboutFooterItem(); + } } diff --git a/inception/pom.xml b/inception/pom.xml index d1c348a2eb8..2e4f344a1bd 100644 --- a/inception/pom.xml +++ b/inception/pom.xml @@ -420,6 +420,7 @@ com.squareup.okio okio-jvm + ${okio.version} test @@ -1067,6 +1068,20 @@ pom import + + com.squareup.okhttp3 + okhttp-bom + ${okhttp.version} + pom + import + + + com.squareup.okio + okio-bom + ${okio.version} + pom + import + org.junit.platform junit-platform-suite-engine @@ -1092,21 +1107,6 @@ assertj-core ${assertj.version} - - com.squareup.okhttp3 - mockwebserver - ${okhttp.version} - - - com.squareup.okio - okio - ${okio.version} - - - com.squareup.okio - okio-jvm - ${okio.version} - no.nav.security mock-oauth2-server @@ -1124,11 +1124,6 @@ nimbus-jose-jwt 9.31 - - com.squareup.okhttp3 - okhttp - ${okhttp.version} - org.awaitility awaitility @@ -2451,6 +2446,11 @@ hibernate-jpamodelgen ${hibernate.version} + + org.apache.logging.log4j + log4j-core + ${log4j2.version} +