Logging is a crucial part of system observability, just like monitoring. When developers and operators encounter issues or need to assess the system’s state, inspecting logs becomes essential.

Luckily, LavinMQ offers various logging features to facilitate this process. To begin, let’s look at where LavinMQ sends its log data to.

LavinMQ log outputs

LavinMQ supports two log outputs:

  • Standard output(Console)
  • Log file

Standard output(console)

By default LavinMQ will send its generated logs to the standard output. No configuration needed for this - it happens out of the box.

Log file

LavinMQ can also be configured to pipe its logs to a file. This can be done by specifying the path to the log file in the config.ini file like so: log_file=/path/to/log/file

In addition to the supported outputs above, logs can also be viewed/retrieved from LavinMQ in a number of ways:

  • Managament interface: You can download the last 1000 lines of logs from the management interface under the Logs tab.
  • HTTP API: The HTTP API exposes two logs endpoints:
    • /:your_server_url/api/logs for retrieving the last 1000 lines of logs
    • /:your_server_url/api/livelog an SSE endpoint that streams log data to a client over HTTP in real time

LavinMQ log levels

Log levels provide a means to filter and adjust logging. They have a clear hierarchy, with debug as the lowest severity and critical as the highest.

You can control logging verbosity on different levels by setting log levels for categories and outputs. More verbose log levels include more log messages, with debug being the most detailed and none being the least.

The log levels used by LavinMQ are as follows:

Log level Verbosity Severity
debug most verbose lowest severity
fatal least verbose highest severity

The default debug level is info. However, this is configurable in the config.ini file like so:


Wrap up

Logging is essential for system observability in LavinMQ. It offers easy access to logs from standard output or log files. The flexibility of log levels aids in effective troubleshooting and optimization.

Ready to take the next steps? Here are some things you should keep in mind:

Managed LavinMQ instance on CloudAMQP

LavinMQ has been built with performance and ease of use in mind - we've benchmarked a throughput of about 1,000,000 messages/sec. You can try LavinMQ without any installation hassle by creating a free instance on CloudAMQP. Signing up is a breeze.

Help and feedback

We welcome your feedback and are eager to address any questions you may have about this piece or using LavinMQ. Join our Slack channel to connect with us directly. You can also find LavinMQ on GitHub.