We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Game Logs

In the Peril game, occasionally we want to "log" a game event. Those logs should go to a central location where they can be inspected later. It's common in large backend systems to print logs to stdout or stderr, but to also send logs to a central logging system or database.

Assignment

Whenever "war" events happen, we want to log them. For now, let's just add the functionality to publish them, and we'll let the messages pile up in the logs queue.

You should be able to verify in the RabbitMQ management UI that a log was published to the game_logs queue.

If you get a PRECONDITION_FAILED error when starting your server, you may need to delete the existing game_logs queue and restart your server. You cannot redeclare a queue with different arguments.

Run and submit the CLI tests.