Skip to content

Commit

Permalink
#186 fix(logs on tomcat and support gis 3.1)
Browse files Browse the repository at this point in the history
  • Loading branch information
qifeng-bai committed Dec 6, 2021
1 parent 02cc64c commit ffda0c6
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 14 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ dependencies {
compile "org.codehaus.jackson:jackson-core-asl:1.8.6"
compile "org.codehaus.jackson:jackson-mapper-asl:1.8.6"

compile("au.org.ala:layers-store:2.0.7-SNAPSHOT") {
compile("au.org.ala:layers-store:2.0.8-SNAPSHOT") {
exclude module: "spring-context"
exclude module: "spring-jdbc"
exclude module: "spring-orm"
Expand All @@ -161,9 +161,9 @@ dependencies {
configurations {
all {
exclude group: "org.slf4j", module: "slf4j-nop"
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
exclude group: 'ch.qos.logback', module: 'logback-classic'
exclude group: 'ch.qos.logback', module: 'logback-core'
// exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
// exclude group: 'ch.qos.logback', module: 'logback-classic'
// exclude group: 'ch.qos.logback', module: 'logback-core'
}
}

Expand Down
6 changes: 3 additions & 3 deletions grails-app/conf/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,9 @@ spring:
# host: "localhost"
# port: 6379
# password: ""
logging:
level:
root: INFO
#logging:
# level:
# root: INFO

environments:
development:
Expand Down
19 changes: 15 additions & 4 deletions grails-app/conf/logback.groovy
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import grails.util.Environment
import org.springframework.boot.logging.logback.ColorConverter
import org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter
import java.nio.charset.Charset
Expand All @@ -10,13 +11,23 @@ appender('STDOUT', ConsoleAppender) {
encoder(PatternLayoutEncoder) {
charset = Charset.forName('UTF-8')
pattern =
'[SPATIAL-SERVICE] %clr(%d{HH:mm:ss.SSS}){faint} ' + // Date
'[SPATIAL-SERVICE] %clr(%d{HH:mm:ss}){faint} ' + // Date
'%clr(%logger{5}){cyan} %clr(:){faint} ' + // Logger
'%m%n%wex' // Message
}
}
logger("au.org.ala.spatial.service.MonitorService", INFO, ['STDOUT'], false)
logger("au.org.ala.layers", DEBUG, ['STDOUT'], false)
logger("au.org.ala.spatial", DEBUG, ['STDOUT'], false)
if (Environment.isDevelopmentMode()) {
logger("au.org.ala.spatial.service.MonitorService", INFO, ['STDOUT'], false)
logger("au.org.ala.layers", DEBUG, ['STDOUT'], false)
logger("au.org.ala.spatial", DEBUG, ['STDOUT'], false)
logger("org.hibernate", ERROR, ['STDOUT'], false)
logger("au.org.ala",DEBUG, ['STDOUT'],false)
} else {
logger("au.org.ala.spatial.service.MonitorService", INFO, ['STDOUT'], false)
logger("au.org.ala.layers", INFO, ['STDOUT'], false)
logger("au.org.ala.spatial", INFO, ['STDOUT'], false)
logger("au.org.ala", DEBUG, ['STDOUT'],false)
}


root(ERROR, ['STDOUT'])
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,10 @@ class ShapesController {
}

} catch (ParseException e) {
log.error("Invalid WKT:", e.message)
log.error("Invalid WKT:", e.message, e)
retMap.put("error", "Invalid WKT:" + e.message)
} catch (Exception e) {
log.error("Error in processing WKT", e.message)
log.error("Error in processing WKT", e.message, e)
retMap.put("error", "Unexpected error: " + e.message)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import au.org.ala.layers.dao.LayerDAO
import grails.converters.JSON
import grails.converters.XML
import grails.core.GrailsApplication
import groovy.util.logging.Slf4j
import org.apache.commons.io.FileUtils
import org.apache.commons.io.IOUtils
import org.hibernate.criterion.CriteriaSpecification
Expand Down Expand Up @@ -55,6 +56,7 @@ class ManageLayersController {
* @return
*/
def layers() {
log.info("List avaliable layers")
Map map = [:]
map.put("layers", manageLayersService.getAllLayers(null))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class UrlMappings {
"/distribution/map/$lsid**?"(controller: "distribution", action: "lsidMapFirst")
"/distribution/map/png/$geomIdx(.$format)?"(controller: "distribution", action: "overviewMapPng")
"/distribution/map/seed(.$format)?"(controller: "distribution", action: "overviewMapSeed")
"/distribution/outliers/$lsid?"(controller: "distribution", action: "outliers")
"/distribution/outliers/$lsid**?"(controller: "distribution", action: "outliers")
"/distribution/map/lsid/$lsid**?"(controller: "distribution", action: "overviewMapPngLsid")
"/distribution/map/spcode/$spcode(.$format)?"(controller: "distribution", action: "overviewMapPngSpcode")
"/distribution/map/name/$name(.$format)?"(controller: "distribution", action: "overviewMapPngName")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class ScatterplotCreate extends SlaveProcess {
try {
ScatterplotStyleDTO style = new ScatterplotStyleDTO()
taskLog("Creating scatter plot.....")
log.info("Creating scatter plot.")
Scatterplot scatterplot = new Scatterplot(desc, style, null, getTaskPath(), task.input.resolution.toString(), task.input.layersServiceUrl)

if (layers.length <= 2) {
Expand Down

0 comments on commit ffda0c6

Please sign in to comment.