Merge pull request #542 from corda/ags_2018-03-12

Merge from OS 20180312
This commit is contained in:
Andrzej Grzesik 2018-03-12 12:27:10 +00:00 committed by GitHub
commit c2e89f007c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 47 additions and 5 deletions

View File

@ -70,5 +70,9 @@
<Logger name="org.apache.activemq.artemis.core.server" level="error" additivity="false">
<AppenderRef ref="RollingFile-Appender"/>
</Logger>
<Logger name="org.jolokia" additivity="true" level="warn">
<AppenderRef ref="Console-Appender-Println"/>
<AppenderRef ref="RollingFile-Appender" />
</Logger>
</Loggers>
</Configuration>

View File

@ -20,7 +20,7 @@ stored states, transactions and attachments as follows:
``Database connection URL is : jdbc:h2:tcp://10.18.0.150:56736/node``
* Paste this string into the JDBC URL field and click ``Connect``, using the default username and password.
* Paste this string into the JDBC URL field and click ``Connect``, using the default username (``sa``) and no password.
You will be presented with a web interface that shows the contents of your node's storage and vault, and provides an
interface for you to query them using SQL.

View File

@ -223,8 +223,8 @@ dependencies {
throw new GradleException('Unsupported DB provider: ' + DB_PROVIDER)
}
// Jolokia JVM monitoring agent
runtime "org.jolokia:jolokia-jvm:${jolokia_version}:agent"
// Jolokia JVM monitoring agent, required to push logs through slf4j
compile "org.jolokia:jolokia-jvm:${jolokia_version}:agent"
}
task integrationTest(type: Test) {

View File

@ -78,7 +78,7 @@ class ArgsParser {
val networkRootTrustStorePassword = optionSet.valueOf(networkRootTrustStorePasswordArg)
val registrationConfig = if (isRegistration) {
requireNotNull(networkRootTrustStorePassword) { "Network root trust store password must be provided in registration mode." }
requireNotNull(networkRootTrustStorePassword) { "Network root trust store password must be provided in registration mode using --network-root-truststore-password." }
require(networkRootTrustStorePath.exists()) { "Network root trust store path: '$networkRootTrustStorePath' doesn't exist" }
NodeRegistrationOption(networkRootTrustStorePath, networkRootTrustStorePassword)
} else {
@ -119,7 +119,7 @@ data class CmdLineOptions(val baseDirectory: Path,
mapOf("noLocalShell" to this.noLocalShell)
)).parseAsNodeConfiguration()
if (nodeRegistrationConfig != null) {
requireNotNull(config.compatibilityZoneURL) { "Compatibility Zone Url must be provided in registration mode." }
requireNotNull(config.compatibilityZoneURL) { "Compatibility Zone URL (compatibilityZoneURL) must be present in node configuration file in registration mode." }
}
return config
}

View File

@ -0,0 +1,35 @@
package net.corda.node
import org.jolokia.util.LogHandler
import org.slf4j.Logger
import org.slf4j.LoggerFactory
class JolokiaSlf4jAdapter : LogHandler {
companion object {
val log: Logger = LoggerFactory.getLogger("org.jolokia")
}
override fun error(message: String?, t: Throwable?) {
if (message != null) {
if (t != null) {
log.error(message, t)
} else {
log.error(message)
}
} else if (t != null) {
log.error("Exception without a comment", t)
}
}
override fun debug(message: String?) {
if (message != null) {
log.debug(message)
}
}
override fun info(message: String?) {
if (message != null) {
log.info(message)
}
}
}

View File

@ -35,5 +35,8 @@
<Logger name="org.hibernate.SQL" level="info" additivity="false">
<AppenderRef ref="Console-Appender"/>
</Logger>
<Logger name="org.jolokia" additivity="true" level="warn">
<AppenderRef ref="Console-Appender-Println"/>
</Logger>
</Loggers>
</Configuration>