Staring Into the Void: A Love Letter to Log Files

When something goes wrong, systems tell the truth in only one place: their logs. A small declaration of love – and a log server for learning, close to what you would run in production.

Comic: the man reads a love letter from a pink envelope at a desk in a data center, the letter is full of glowing log lines

🌐 Also available in: Deutsch · Français · Español · Italiano · Português · Nederlands · Polski

In short: Logs are where systems tell the truth – loud, sometimes ugly, but indispensable when something goes wrong. Today I installed Graylog (opens in a new tab) and Fluent Bit (opens in a new tab) on my server, as a learning environment close to what you would run in production. The post explains why logging matters so much and shows my Fluent Bit configuration.

If you’ve ever stared at a terminal full of log messages, you know: logs are where systems tell the truth. They are noisy, sometimes ugly, but absolutely essential when things go wrong. Today I installed Graylog and Fluent Bit on my server. Not only because I work with these tools professionally, but also because I will increasingly use them in the future, as my homelab is meant for experimenting, learning, and keeping my brain busy.

Why Logging Matters

Logging is one of the most fundamental building blocks of reliable systems. Metrics tell you that something is wrong, logs tell you why. Centralised logging becomes crucial once you operate more than a single machine.

Fluent Bit, Graylog & Sidecar

Fluent Bit acts as the client component on the server. Its job is simple: collect logs locally and ship them to Graylog.

Graylog provides the GUI and backend where logs are stored, processed, searched, and used for alerting. It can easily be used to collect log messages from several thousand servers and analyse them centrally.

Sidecar is an additional service that allows centralised configuration of the Fluent Bit agent directly from Graylog, making rollouts and changes much more convenient.

Memory Tuning & First Lessons Learned

Functionally everything worked quite well, but I had to significantly reduce the RAM requirements. Interestingly, Graylog immediately grabbed swap space — even though the server has a total of 32 GB RAM available.

These Java-related memory topics are still new to me, so that’s something I’ll have to dig deeper into. For the beginning, having a Grafana dashboard was extremely helpful to monitor CPU and RAM usage in detail.

To limit heap usage, I added the following entry to /etc/graylog/datanode/datanode.conf:

opensearch_heap = 2g

Fluent Bit Configuration Example

The following is the current Fluent Bit configuration running on my Ubuntu/Debian system. It collects logs from multiple local sources (systemd journal, syslog, auth logs, and kernel logs) and forwards everything to Graylog using the GELF output over TCP.

This setup works well for a homelab environment while still being close to what you would run in production.


############################################
# Fluent Bit – Ubuntu / Debian
############################################

[SERVICE]
    Flush        30
    Daemon       Off
    Log_Level    info
    storage.type memory


###################################################################
# INPUTS
###################################################################

# Systemd Journal (primary input source)
[INPUT]
    Name              systemd
    Tag               journal.*
    Read_From_Tail    On


# /var/log/syslog
[INPUT]
    Name              tail
    Path              /var/log/syslog
    Tag               syslog.*
    DB                /var/log/fluent-bit/db_syslog.db
    Mem_Buf_Limit     5MB
    Skip_Long_Lines   On


# Authentication Logs
[INPUT]
    Name              tail
    Path              /var/log/auth.log
    Tag               auth.*


# Kernel Log
[INPUT]
    Name              tail
    Path              /var/log/kern.log
    Tag               kernel.*


###################################################################
# OUTPUT
###################################################################

[OUTPUT]
    Name                    gelf
    Match                   *
    Host                    192.168.10.x
    Port                    12201
    Mode                    udp
    Gelf_Short_Message_Key  log
    Gelf_Host_Key           host

With this configuration, Fluent Bit reliably ships all relevant system logs to Graylog, where they can be indexed, searched, and used for alerting.

Final Thoughts

Centralised logging is a powerful tool — even (or especially) in a homelab. It helps build intuition for production systems and makes troubleshooting far less painful when things eventually break.

Graylog dashboard with homelab log statistics Graylog search view filtering homelab logs Graylog message list from the homelab servers Graylog stream and input overview Graylog widget charting log volume over time Graylog web interface overview

🎯 Conclusion

Metrics show that something is wrong; logs show why. With Graylog and Fluent Bit, my server’s logs end up in one central, searchable place – small enough for the homelab and close enough to production to learn from it for work.


📚 Related posts:

Some text, images, videos and audio on this site are AI-assisted or AI-generated. Details