Skip to content

Commit

Permalink
Merge branch 'release/6.1.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
cdausmus committed Sep 28, 2023
2 parents da9f870 + a3e17a1 commit 058bfdf
Show file tree
Hide file tree
Showing 6 changed files with 143 additions and 197 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ branches:
only:
- master
- develop
- feature/grails-5-upgrade
- feature/dg-101
services:
- postgresql
addons:
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ plugins {
id "com.dorongold.task-tree" version "2.1.1"
}

version "6.1.5"
version "6.1.6"
group "au.org.ala"
description "Digivol application"

Expand Down
157 changes: 23 additions & 134 deletions grails-app/conf/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,32 @@
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />

<variable name="loggingDir" value="${catalina.base:-./logs}" />
<!-- <variable name="loggingDir" value="${LOGGING_DIR:-/tmp/}" />-->
<variable name="appName" value="digivol" />

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.core.filter.EvaluatorFilter">
<evaluator> <!-- defaults to type ch.qos.logback.classic.boolex.JaninoEventEvaluator -->
<evaluator>
<expression>return logger.equals("org.grails.plugins.rx.web.RxResultSubscriber") &amp;&amp; message.contains("Async Dispatch Error: Broken pipe");</expression>
</evaluator>
<OnMismatch>NEUTRAL</OnMismatch>
<OnMatch>DENY</OnMatch>
</filter>
<!-- <filter class="ch.qos.logback.core.filter.EvaluatorFilter">-->
<!-- <evaluator> &lt;!&ndash; defaults to type ch.qos.logback.classic.boolex.JaninoEventEvaluator &ndash;&gt;-->
<!-- <expression>return logger.equals("org.elasticsearch.cluster.routing.allocation.decider");</expression>-->
<!-- </evaluator>-->
<!-- <OnMismatch>ACCEPT</OnMismatch>-->
<!-- <OnMatch>DENY</OnMatch>-->
<!-- </filter>-->
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<filter class="ch.qos.logback.core.filter.EvaluatorFilter">
<evaluator>
<expression>return logger.equals("org.elasticsearch.cluster.routing.allocation.decider");</expression>
</evaluator>
<OnMismatch>ACCEPT</OnMismatch>
<OnMatch>DENY</OnMatch>
</filter>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %5p --- [%15.15t] %-40.40logger{39} : %m%n%wex</pattern>
</encoder>
</appender>

<!--
<appender name="TOMCAT_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.core.filter.EvaluatorFilter">
<evaluator> <!-- defaults to type ch.qos.logback.classic.boolex.JaninoEventEvaluator -->
<evaluator>
<expression>return logger.equals("org.grails.plugins.rx.web.RxResultSubscriber") &amp;&amp; message.contains("Async Dispatch Error: Broken pipe");</expression>
</evaluator>
<OnMismatch>NEUTRAL</OnMismatch>
Expand All @@ -49,149 +47,40 @@
</triggeringPolicy>
<encoder>
<charset>UTF-8</charset>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %5p --- [%15.15t] %-40.40logger{39} : %m%n%wex</pattern>
<!-- <pattern>%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(-&#45;&#45;){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wex</pattern>-->
</encoder>
</appender>

<appender name="ACCESS" class="ch.qos.logback.core.rolling.RollingFileAppender">

<file>${loggingDir}/${appName}-session-access.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>${loggingDir}/${appName}-session-access.%i.log.gz</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>4</maxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>10MB</maxFileSize>
</triggeringPolicy>
<encoder>
<charset>UTF-8</charset>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %5p --- [%15.15t] %-40.40logger{39} : %m%n%wex</pattern>
<!-- <pattern>%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(-&#45;&#45;){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wex</pattern>-->
</encoder>
</appender>

<appender name="CAS" class="ch.qos.logback.core.rolling.RollingFileAppender">

<file>${loggingDir}/${appName}-cas.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>${loggingDir}/${appName}-cas.%i.log.gz</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>4</maxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>10MB</maxFileSize>
</triggeringPolicy>
<encoder>
<charset>UTF-8</charset>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %5p --- [%15.15t] %-40.40logger{39} : %m%n%wex</pattern>
<!-- <pattern>%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(-&#45;&#45;){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wex</pattern>-->
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %5p - [%15.15t] %-40.40logger{39} : %m%n%wex</pattern>
</encoder>
</appender>

<appender name="DEBUG_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">

<file>${loggingDir}/${appName}-debug.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>${loggingDir}/${appName}-debug.%i.log.gz</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>4</maxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>10MB</maxFileSize>
</triggeringPolicy>
<encoder>
<charset>UTF-8</charset>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %5p --- [%15.15t] %-40.40logger{39} : %m%n%wex</pattern>
<!-- <pattern>%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(-&#45;&#45;){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wex</pattern>-->
</encoder>
</appender>

<appender name="QUERY_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">

<file>${loggingDir}/${appName}-slow-queries.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>${loggingDir}/${appName}-slow-queries.%i.log.gz</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>4</maxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>10MB</maxFileSize>
</triggeringPolicy>
<encoder>
<charset>UTF-8</charset>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %5p --- [%15.15t] %-40.40logger{39} : %m%n%wex</pattern>
<!-- <pattern>%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(-&#45;&#45;){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wex</pattern>-->
</encoder>
</appender>

<!-- Ancilliary logs -->

<!-- Web Access Logs -->
<logger name="au.org.ala.volunteer.BVPServletFilter" level="INFO" additivity="false">
<appender-ref ref="ACCESS"/>
</logger>
<logger name="au.org.ala.volunteer.BVPSessionListener" level="DEBUG" additivity="false">
<appender-ref ref="ACCESS"/>
</logger>

<!-- CAS session logs -->
<logger name="au.org.ala.cas" level="DEBUG" additivity="false">
<appender-ref ref="CAS"/>
</logger>
<logger name="org.jasig.cas" level="DEBUG" additivity="false">
<appender-ref ref="CAS"/>
</logger>
-->

<!-- Debug Logs -->
<!--
<logger name="au.org.ala.volunteer.Task" level="DEBUG" additivity="false">
<appender-ref ref="DEBUG_LOG"/>
</logger>
<logger name="au.org.ala.volunteer.TaskService" level="DEBUG" additivity="false">
<appender-ref ref="DEBUG_LOG"/>
</logger>
<logger name="au.org.ala.volunteer.TaskLoadService" level="DEBUG" additivity="false">
<appender-ref ref="DEBUG_LOG"/>
</logger>
<logger name="au.org.ala.volunteer.TaskIngestJob" level="INFO" additivity="false">
<appender-ref ref="DEBUG_LOG"/>
</logger>
<logger name="au.org.ala.volunteer.ValidationService" level="DEBUG" additivity="false">
<appender-ref ref="DEBUG_LOG"/>
</logger>
<logger name="au.org.ala.volunteer.TranscribeController" level="DEBUG" additivity="false">
<appender-ref ref="DEBUG_LOG"/>
</logger>
<logger name="au.org.ala.volunteer.ValidateController" level="DEBUG" additivity="false">
<appender-ref ref="DEBUG_LOG"/>
</logger>

<!-- Slow queries -->
<logger name="org.apache.tomcat.jdbc.pool.interceptor.SlowQueryReport" level="INFO" additivity="false">
<appender-ref ref="QUERY_LOG"/>
</logger>
-->

<logger name="org.hibernate.orm.deprecation" level="ERROR" />

<logger name="org.grails.config.NavigableMap" level="ERROR" />
<logger name="grails.spring.BeanBuilder" level="ERROR" />
<logger name="grails.plugin.cache.web.filter" level="ERROR" />
<logger name="au.org.ala.cas.client" level="WARN" />
<logger name="au.org.ala.cas.util" level="WARN" />
<logger name="org.apache.coyote.http11.Http11Processor" level="WARN" />

<logger name="asset.pipeline" level="INFO" />
<logger name="au.org.ala" level="INFO" />
<logger name="grails.app" level="INFO" />
<logger name="grails.plugins.mail" level="INFO" />
<logger name="grails.plugins.quartz" level="INFO" />
<logger name="grails.plugin.cache" level="INFO" />
<logger name="org.hibernate" level="INFO" />
<logger name="org.hibernate.SQL" level="INFO" />
<logger name="org.quartz" level="INFO" />
<logger name="org.springframework" level="INFO" />
<logger name="org.flywaydb" level="INFO" />
<logger name="org.flywaydb" level="TRACE" />
<logger name="grails.plugin.externalconfig.ExternalConfig" level="INFO" />
<logger name="au.org.ala.volunteer.DomainUpdateService" level="INFO" />
<logger name="au.org.ala" level="INFO" />
<logger name="au.org.ala.volunteer" level="INFO" />

<root level="INFO">
<appender-ref ref="STDOUT" />
<appender-ref ref="TOMCAT_LOG" />
<!-- <appender-ref ref="TOMCAT_LOG" /> -->
</root>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ class FullTextIndexService {
def initialize() {
log.info("ElasticSearch service starting...")
Settings.Builder settings = Settings.builder()
settings.put("path.home", grailsApplication.config.getProperty('elasticsearch.location', String) as String)
def settingsMap = getSettings()
settingsMap.each { element, value ->
log.debug("Elastic Search init setting: [${element}], Value: [${value}]")
settings.put(element, value as String)
}

node = nodeBuilder().local(true).settings(settings).node()
client = node.client()
client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet()
Expand Down Expand Up @@ -79,6 +84,21 @@ class FullTextIndexService {
addMappings()
}

@NotTransactional
def getSettings() {
def settings = [:]
settings["path.home"] = grailsApplication.config.getProperty('elasticsearch.location', String)
def watermarkLow = grailsApplication.config.getProperty('elasticsearch.cluster.routing.allocation.disk.watermark.low', String) as String
if (watermarkLow) {
settings["cluster.routing.allocation.disk.watermark.low"] = watermarkLow
}
def watermarkHigh = grailsApplication.config.getProperty('elasticsearch.cluster.routing.allocation.disk.watermark.high', String) as String
if (watermarkHigh) {
settings["cluster.routing.allocation.disk.watermark.high"] = watermarkHigh
}
return settings
}

def indexTask(Task task) {

//def ct = new CodeTimer("Indexing task ${task.id}")
Expand Down
Loading

0 comments on commit 058bfdf

Please sign in to comment.