Skip to content

Commit

Permalink
Merge pull request #286 from charvolant/master
Browse files Browse the repository at this point in the history
Release 1.4.10
  • Loading branch information
charvolant authored Mar 4, 2020
2 parents 6fd6dae + 676d01b commit fd2c65d
Show file tree
Hide file tree
Showing 6 changed files with 154 additions and 81 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ buildscript {
}
}

version "1.4.10-SNAPSHOT"
version "1.4.10"
group "au.org.ala"

apply plugin:"eclipse"
Expand Down
23 changes: 23 additions & 0 deletions grails-app/conf/logback.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import java.nio.charset.Charset
def loggingDir = (System.getProperty('catalina.base') ? System.getProperty('catalina.base') + '/logs' : './logs')
def appName = 'bie-index'
final TOMCAT_LOG = 'TOMCAT_LOG'
final IMPORT_LOG = 'IMPORT_LOG'
final FULL_STACKTRACE = 'FULL_STACKTRACE'
final STDOUT = 'STDOUT'

Expand Down Expand Up @@ -35,8 +36,30 @@ switch (Environment.current) {
maxFileSize = FileSize.valueOf('10MB')
}
}
appender(IMPORT_LOG, RollingFileAppender) {
file = "${loggingDir}/${appName}-import.log"
encoder(PatternLayoutEncoder) {
pattern =
'%d{yyyy-MM-dd HH:mm:ss.SSS} ' + // Date
'%5p ' + // Log level
'--- [%15.15t] ' + // Thread
'%-40.40logger{39} : ' + // Logger
'%m%n%wex' // Message
}
rollingPolicy(FixedWindowRollingPolicy) {
fileNamePattern = "${loggingDir}/${appName}.%i.log.gz"
minIndex = 1
maxIndex = 4
}
triggeringPolicy(SizeBasedTriggeringPolicy) {
maxFileSize = FileSize.valueOf('10MB')
}
}
root(WARN, [TOMCAT_LOG])
logger('au.org.ala', INFO)
logger('grails.app.controllers.au.org.ala', INFO)
logger('grails.app.services.au.org.ala', INFO)
logger('grails.app.services.au.org.ala.bie.ImportService', INFO, [IMPORT_LOG], false)
break
case Environment.TEST:
appender(TOMCAT_LOG, RollingFileAppender) {
Expand Down
14 changes: 9 additions & 5 deletions grails-app/controllers/au/org/ala/bie/SearchController.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,15 @@ class SearchController implements GrailsConfigurationAware {
*/
// Documented in openapi.yml
def download(){
response.setHeader("Cache-Control", "must-revalidate");
response.setHeader("Pragma", "must-revalidate");
response.setHeader("Content-Disposition", "attachment;filename=${params.file?:'species.csv'}");
response.setContentType("text/csv");
downloadService.download(params, response.outputStream, request.locale)
if (!params.q?.trim()) {
response.sendError(400, "A q parameter is required")
} else {
response.setHeader("Cache-Control", "must-revalidate");
response.setHeader("Pragma", "must-revalidate");
response.setHeader("Content-Disposition", "attachment;filename=${params.file ?: 'species.csv'}");
response.setContentType("text/csv");
downloadService.download(params, response.outputStream, request.locale)
}
}

/**
Expand Down
Loading

0 comments on commit fd2c65d

Please sign in to comment.