From 57c7c88b199fd10945aa2e7c7e08231dc0f15d4a Mon Sep 17 00:00:00 2001 From: Zlatko Murgoski Date: Thu, 13 Jun 2019 16:54:28 +0200 Subject: No available docker logs https://jira.onap.org/browse/DCAEGEN2-1618 Issue-ID: DCAEGEN2-1618 Signed-off-by: Zlatko Murgoski Change-Id: If44392a5d5654952cbf1f8f048d9c6deb6ced832 --- etc/log4j.xml | 173 -------------------------------------- etc/logrotate.conf | 7 -- pom.xml | 7 +- src/main/resources/log4j2.xml | 152 +++++++++++++++++++++++++++++++++ src/main/scripts/appController.sh | 2 +- src/main/scripts/docker-entry.sh | 13 --- 6 files changed, 156 insertions(+), 198 deletions(-) delete mode 100644 etc/log4j.xml delete mode 100644 etc/logrotate.conf create mode 100644 src/main/resources/log4j2.xml diff --git a/etc/log4j.xml b/etc/log4j.xml deleted file mode 100644 index aa836eb1..00000000 --- a/etc/log4j.xml +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/etc/logrotate.conf b/etc/logrotate.conf deleted file mode 100644 index 41bf4edc..00000000 --- a/etc/logrotate.conf +++ /dev/null @@ -1,7 +0,0 @@ -/opt/app/VESCollector/logs/collector.log { - size 64M - rotate 10 - copytruncate - dateext - dateformat .%Y-%m-%dT%H:%M:%S -} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 677736f5..735f7a39 100644 --- a/pom.xml +++ b/pom.xml @@ -160,8 +160,7 @@ chmod +x bin/*.sh - - chmod 0644 etc/logrotate.conf + 8080 @@ -342,8 +341,8 @@ org.springframework.boot - spring-boot-starter-log4j - 1.3.8.RELEASE + spring-boot-starter-log4j2 + 2.1.5.RELEASE io.springfox diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml new file mode 100644 index 00000000..649441d7 --- /dev/null +++ b/src/main/resources/log4j2.xml @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/scripts/appController.sh b/src/main/scripts/appController.sh index f5094dcc..bdb2c812 100644 --- a/src/main/scripts/appController.sh +++ b/src/main/scripts/appController.sh @@ -35,7 +35,7 @@ start() { -XX:ErrorFile=logs/java_error%p.log \ -XX:+HeapDumpOnOutOfMemoryError \ -Dhttps.protocols=TLSv1.1,TLSv1.2 \ - org.onap.dcae.VesApplication $* &>> logs/collector.log & + org.onap.dcae.VesApplication $* & } stop() { diff --git a/src/main/scripts/docker-entry.sh b/src/main/scripts/docker-entry.sh index 6b300669..3131a1a6 100644 --- a/src/main/scripts/docker-entry.sh +++ b/src/main/scripts/docker-entry.sh @@ -21,19 +21,6 @@ ### source bin/logger.sh -# Redirect all stdout & stderr to a main log file, but also let it print into the console -# At the time this script is invoked, these directories and files do not exist yet, so we need to create them -mkdir -p logs -touch logs/collector.log -exec &> >(tee -a logs/collector.log) - -log "Enabling log rotation for collector.log" -loggedCommand "cp etc/logrotate.conf /etc/logrotate.d" -echo "* * * * * root logrotate /etc/logrotate.conf" >> /etc/crontab -log "Restarting cron" -loggedCommand "service cron reload" -loggedCommand "service cron start" - log "Main application entry-point invoked" if [ ! -z ${COLLECTOR_IP} ]; then -- cgit 1.2.3-korg