You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Basic/logging-cordapp/README.md
+21-7Lines changed: 21 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,20 +25,29 @@ This can be quite powerful if you're looking to produce a consumable output stre
25
25
You can end up getting log feeds in json that look something like this:
26
26
27
27
```json
28
-
{"epochSecond":1612369055,"nanoOfSecond":12000000},"thread":"main","level":"INFO","loggerName":"net.corda.node.internal.Node","message":"Vendor: Corda Open Source","endOfBatch":true,"loggerFqcn":"org.apache.logging.slf4j.Log4jLogger","threadId":1,"threadPriority":5}
28
+
{"instant":{"epochSecond":1612369055,"nanoOfSecond":12000000},"thread":"main","level":"INFO","loggerName":"net.corda.node.internal.Node","message":"Vendor: Corda Open Source","endOfBatch":true,"loggerFqcn":"org.apache.logging.slf4j.Log4jLogger","threadId":1,"threadPriority":5}
{"instant":{"epochSecond":1612460472,"nanoOfSecond":304000000},"thread":"Node thread-1","level":"INFO","loggerName":"net.corda","message":"Initializing the transaction.","endOfBatch":true,"loggerFqcn":"org.apache.logging.slf4j.Log4jLogger","threadId":166,"threadPriority":5}
In the original yo application, the app sent what is essentially a nudge from one endpoint and another.
45
+
In the original yo application that this sample was based on, the app sent what is essentially a "yo" state from one node to another.
39
46
40
47
In corda, we can use abstractions to accomplish the same thing.
41
48
49
+
If you're not interested in how the cordapp works and want to see the logging, feel free to skip down to the usage section.
50
+
42
51
43
52
We define a [state](https://training.corda.net/key-concepts/concepts/#states) (the yo to be shared), define a [contract](https://training.corda.net/key-concepts/concepts/#contracts) (the way to make sure the yo is legit), and define the [flow](https://training.corda.net/key-concepts/concepts/#flows) (the control flow of our cordapp).
44
53
@@ -133,16 +142,21 @@ To see all the Yo's! other nodes have sent you in your vault (you do not store t
133
142
134
143
### Viewing custom logs
135
144
136
-
This will depend on your cordapp setup, if you're running your corda nodes all you need to do is specify the particular config file. You can do that in a couple of ways.
145
+
This will depend on your cordapp setup, if you're running your corda nodes all you need to do is specify the particular config file.
If you're running with the bootstrapped corda network you can run it by simply adding this argument to the result of the runnodes command.
155
+
156
+
- Or if you're running with the bootstrapped corda network you can add this argument to the result of the runnodes command.
144
157
145
158
> notice that all we're doing is adding this param to the command we'd otherwise use to run corda in order to specify the log file.
159
+
> When you normally run the node bootstrapper on localhost you'll see that it will generate a command that looks like this for each node on your network. All you'd need to do is add the log4j configurationFile flag to that startup command to have access to these logs in your node as well.
0 commit comments