Skip to content

Commit f180182

Browse files
committed
working logging from cordapps and gradle config
1 parent 1f15002 commit f180182

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

Basic/logging-cordapp/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,17 @@ Then type: (to run the nodes)
122122
./build/nodes/runnodes
123123
```
124124

125+
When the nodes run you'll see the log entries in json on STDOUT, and you'll also be able to see the node's json log files in each folder.
126+
127+
```shell
128+
cat ./build/nodes/PartyA/logs/node.json
129+
130+
{"instant":{"epochSecond":1612543764,"nanoOfSecond":930000000},"thread":"main","level":"INFO","loggerName":"net.corda.cliutils.CliWrapperBase","message":"Application Args: run-migration-scripts --core-schemas --app-schemas","endOfBatch":true,"loggerFqcn":"org.apache.logging.slf4j.Log4jLogger","contextMap":{},"threadId":1,"threadPriority":5}
131+
{"instant":{"epochSecond":1612543766,"nanoOfSecond":300000000}
132+
133+
. . .
134+
```
135+
125136
### Sending a Yo
126137

127138
We will interact with the nodes via their specific shells. When the nodes are up and running, use the following command to send a

Basic/logging-cordapp/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ allprojects {
4141

4242
tasks.withType(JavaCompile) {
4343
options.compilerArgs << "-parameters" // Required for shell commands.
44-
// jvmArgs = "-Dlog4j.configurationFile=config/dev/log4j2.xml"
4544
}
4645

4746
jar {
@@ -103,7 +102,7 @@ task deployNodesJava(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
103102
// there are other ways to specify that config for example
104103
extraConfig = [
105104
custom: [
106-
jvmArgs: ["-Dlog4j.configurationFile=$projectDir/config/dev/log4j2.xml"]
105+
jvmArgs: ["-Dlog4j.configurationFile="+projectDir+"/config/dev/log4j2.xml"]
107106
]
108107
]
109108

0 commit comments

Comments
 (0)