Corrected logging location - broken by initialising logger before logging was configured.

This commit is contained in:
Clinton Alexander 2017-03-30 17:57:32 +01:00
parent da88a43e40
commit e87184d1eb
4 changed files with 6 additions and 8 deletions

View File

@ -2,7 +2,6 @@ apply plugin: 'kotlin'
apply plugin: 'java'
apply plugin: 'net.corda.plugins.publish-utils'
// TODO: Break dependency on node and move to another location such as a submodule of client.
description 'Corda node web server'
configurations {
@ -20,12 +19,12 @@ sourceSets {
}
test {
resources {
srcDir "../config/test"
srcDir "$rootDir/config/test"
}
}
main {
resources {
srcDir "../config/dev"
srcDir "$rootDir/config/dev"
}
}
}

View File

@ -56,8 +56,6 @@ data class CmdLineOptions(val baseDirectory: Path,
val loggingLevel: Level,
val logToConsole: Boolean) {
private val log = loggerFor<CmdLineOptions>()
fun loadConfig(allowMissingConfig: Boolean = false, configOverrides: Map<String, Any?> = emptyMap()): Config {
return loadConfig(baseDirectory, configFile, allowMissingConfig, configOverrides)
}
@ -77,6 +75,7 @@ data class CmdLineOptions(val baseDirectory: Path,
.withFallback(appConfig)
.withFallback(defaultConfig)
.resolve()
val log = loggerFor<CmdLineOptions>()
log.info("Config:\n${finalConfig.root().render(ConfigRenderOptions.defaults())}")
return finalConfig
}

View File

@ -34,7 +34,7 @@ fun main(args: Array<String>) {
System.setProperty("consoleLogLevel", "info")
}
System.setProperty("log-path", (cmdlineOptions.baseDirectory / "web/logs").toString())
System.setProperty("log-path", (cmdlineOptions.baseDirectory / "logs/web").toString())
val log = LoggerFactory.getLogger("Main")
println("Logs can be found in ${System.getProperty("log-path")}")

View File

@ -22,12 +22,12 @@ targetCompatibility = 1.6
sourceSets {
test {
resources {
srcDir "../../../config/test"
srcDir "$rootDir/config/test"
}
}
main {
resources {
srcDir "../../../config/dev"
srcDir "$rootDir/config/dev"
}
}
}