From 58dc24c98c057ed1a918b62122d753c9e277efed Mon Sep 17 00:00:00 2001 From: Stoyan Tzenkov Date: Mon, 12 Nov 2018 12:33:58 +0200 Subject: [PATCH 1/3] NY-5109: groovy logging replaced with Spring's logback Signed-off-by: Stoyan Tzenkov --- pom.xml | 5 --- src/main/resources/application-dev.yml | 16 ++++++++- src/main/resources/application-production.yml | 14 ++++++++ src/main/resources/logback-spring.groovy | 33 ------------------- 4 files changed, 29 insertions(+), 39 deletions(-) delete mode 100644 src/main/resources/logback-spring.groovy diff --git a/pom.xml b/pom.xml index ad665e6..4454825 100644 --- a/pom.xml +++ b/pom.xml @@ -129,11 +129,6 @@ 2.9.5 - - org.codehaus.groovy - groovy-all - - io.micrometer micrometer-core diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 83c05a1..ae6c937 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -12,6 +12,20 @@ spring: keyspace-name: account contact-points: localhost port: 9042 + output: + ansi: + enabled: ALWAYS + +# To enable colors in Eclipse: +# Help -> Install New Software... and click "Add..." to add the following URL: +# http://www.mihai-nita.net/eclipse + +logging: + level: + root: INFO + org: + springframework: + web: INFO complete: pending: @@ -28,7 +42,7 @@ management: endpoints: web: exposure: - include: 'prometheus, health, info' + include: 'prometheus, health, info, loggers' metrics: export: prometheus: diff --git a/src/main/resources/application-production.yml b/src/main/resources/application-production.yml index 4d7051c..c5ec602 100644 --- a/src/main/resources/application-production.yml +++ b/src/main/resources/application-production.yml @@ -12,6 +12,20 @@ spring: keyspace-name: ${CASSANDRA_KEYSPACE:account} contact-points: ${CASSANDRA_CONTACT_POINTS:cassandra.cassandra.svc.cluster.local} port: ${CASSANDRA_PORT:9042} + output: + ansi: + enabled: ALWAYS + +# To enable colors in Eclipse: +# Help -> Install New Software... and click "Add..." to add the following URL: +# http://www.mihai-nita.net/eclipse + +logging: + level: + root: INFO + org: + springframework: + web: INFO complete: pending: diff --git a/src/main/resources/logback-spring.groovy b/src/main/resources/logback-spring.groovy deleted file mode 100644 index 417c6c7..0000000 --- a/src/main/resources/logback-spring.groovy +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (C) 2018 Nynja Inc. All rights reserved. - */ - -import ch.qos.logback.classic.encoder.PatternLayoutEncoder -import ch.qos.logback.core.ConsoleAppender -import ch.qos.logback.core.rolling.RollingFileAppender -import ch.qos.logback.core.rolling.TimeBasedRollingPolicy -import ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP -import ch.qos.logback.core.status.OnConsoleStatusListener -import ch.qos.logback.classic.Level - -statusListener(OnConsoleStatusListener) - -def file = "${System.getProperty('log.dir', '')}account-service-%d.%i.log" - -appender("FILE", RollingFileAppender) { - // add a status message regarding the file property - addInfo("Starting logging to $file") - append = true - encoder(PatternLayoutEncoder) { pattern = "%d{HH:mm:ss.SSS} %level %logger - %msg%n" } - rollingPolicy(TimeBasedRollingPolicy) { - fileNamePattern = "$file" - timeBasedFileNamingAndTriggeringPolicy(SizeAndTimeBasedFNATP) { maxFileSize = "10mb" }} -} - -appender("Console-Appender", ConsoleAppender) { - encoder(PatternLayoutEncoder) { pattern = "%d{HH:mm:ss.SSS} %level %logger - %msg%n" } -} - -logger("org.springframework.cloud.config.client.ConfigServicePropertySourceLocator", Level.WARN) -root(INFO, ["Console-Appender"]) -root(Level.toLevel("${System.getProperty('log.level', 'INFO')}"), ["FILE"]) \ No newline at end of file -- GitLab From c9382f025275733cd66bfcf7d59193d8c10c80d3 Mon Sep 17 00:00:00 2001 From: Stoyan Tzenkov Date: Mon, 12 Nov 2018 12:53:32 +0200 Subject: [PATCH 2/3] NY-5109: loggers added to web.exposure in production yml Signed-off-by: Stoyan Tzenkov --- src/main/resources/application-production.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/application-production.yml b/src/main/resources/application-production.yml index c5ec602..f07ba59 100644 --- a/src/main/resources/application-production.yml +++ b/src/main/resources/application-production.yml @@ -42,7 +42,7 @@ management: endpoints: web: exposure: - include: 'prometheus, health, info' + include: 'prometheus, health, info, loggers' metrics: export: prometheus: -- GitLab From ed768f9e2cb3efcc454b47f8dc379bff7c787f14 Mon Sep 17 00:00:00 2001 From: Stoyan Tzenkov Date: Mon, 12 Nov 2018 13:43:02 +0200 Subject: [PATCH 3/3] NY-5109: Color set up in eclipse removed from production yml Signed-off-by: Stoyan Tzenkov --- src/main/resources/application-dev.yml | 8 ++++---- src/main/resources/application-production.yml | 7 ------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index ae6c937..333924b 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -12,13 +12,13 @@ spring: keyspace-name: account contact-points: localhost port: 9042 - output: - ansi: - enabled: ALWAYS - # To enable colors in Eclipse: +# spring.output.ansi.enabled=ALWAYS and in eclipse # Help -> Install New Software... and click "Add..." to add the following URL: # http://www.mihai-nita.net/eclipse + output: + ansi: + enabled: ALWAYS logging: level: diff --git a/src/main/resources/application-production.yml b/src/main/resources/application-production.yml index f07ba59..b13753a 100644 --- a/src/main/resources/application-production.yml +++ b/src/main/resources/application-production.yml @@ -12,13 +12,6 @@ spring: keyspace-name: ${CASSANDRA_KEYSPACE:account} contact-points: ${CASSANDRA_CONTACT_POINTS:cassandra.cassandra.svc.cluster.local} port: ${CASSANDRA_PORT:9042} - output: - ansi: - enabled: ALWAYS - -# To enable colors in Eclipse: -# Help -> Install New Software... and click "Add..." to add the following URL: -# http://www.mihai-nita.net/eclipse logging: level: -- GitLab