When programming in the event loop paradigm, application logic is often
spread across multiple event loop turns, as processing of one event triggers
other events, which each may trigger further events. In a distributed
application, this causal chaining of events also crosses the network, as an
event is triggered on one machine and processed on another. To enable tracing of
these execution paths, the Waterken server can be configured to emit a log of
every event triggered or processed. To facilitate debugging of applications that
run on multiple machines, these log events can be transmitted, as they occur, to
a centralized viewing application.

The default configuration files that come
with the waterken-server distribution setup the server as a log event store, so
the feature just needs to be turned on. To do so, you will first need to
generate the web-key used to transmit log events. The key part of this web-key
can come from a web-key created by a discarded test application. Configure your
server with this key by putting it in the config/logKey.json file.
For example, the contents of this file should look like:

For each server transmitting log events, add a file named
log.json to its
config/ folder. This file
specifies the web-key used in sending log events. For example,

{ "@" : "http://localhost:8080/~/log/#s=mySecretKey" }

The above example sends log events to the previously configured log store on
the local machine. The received events are stored in the file
config/log/live.log. This file uses JSON syntax, but the closing
']' is missing. Manually add the closing bracket before using the
file with any JSON parsing software.

You may also wish to output log comments to the
console. If so, use the following content for log.json: