Logs are the nervous system of your IT infrastructure. They reveal what happened, when it happened, and why. Whether you are running Linux servers, Cisco routers, or firewalls, logs provide the visibility you need for troubleshooting, security, and compliance.
While there are commercial platforms for centralized logging, you can actually build your own free syslog server with open-source tools. This guide shows you how, step by step, and explains why many teams eventually migrate to a managed solution like LogCentral.
What is Syslog?
Syslog is a standard protocol defined in RFC 5424 for message logging. It has been around since the 1980s and is supported by almost every network device and Unix-like operating system. A syslog message typically contains:
- Priority (combining facility and severity)
- Timestamp
- Hostname
- Message content
Syslog servers listen on UDP port 514 by default, but can also use TCP and TLS for reliability and security. This makes syslog a universal way to centralize logs.
Why Centralize Logs?
- Security: Detect intrusions, brute-force login attempts, and suspicious activity across multiple systems.
- Operations: Troubleshoot errors spanning different applications and servers.
- Compliance: Regulations like PCI-DSS, HIPAA, or SOC 2 often mandate centralized logging and retention.
- Efficiency: Searching one central place is faster than digging into multiple machines.
How to Build a Free Syslog Server
You can build a syslog server on almost any Linux distribution. Let’s start with Rsyslog, the default logging daemon on Ubuntu, Debian, and CentOS.
1. Setting Up Rsyslog
Install Rsyslog (if not already installed):
sudo apt update
sudo apt install rsyslog
Edit the configuration in /etc/rsyslog.conf
to accept logs from remote devices:
module(load="imudp")
input(type="imudp" port="514")
module(load="imtcp")
input(type="imtcp" port="514")
# Enable TLS for secure logging
module(load="imptcp")
Restart Rsyslog:
sudo systemctl restart rsyslog
Test with the logger command:
logger -n 127.0.0.1 -P 514 "Test syslog message"
2. Using syslog-ng
syslog-ng is another popular syslog daemon, known for its flexibility and filtering power. You can run it directly on Linux or inside Docker. Example docker-compose.yml
:
version: '3'
services:
syslog-ng:
image: balabit/syslog-ng:latest
ports:
- "514:514/udp"
- "601:601/tcp"
volumes:
- ./syslog-ng.conf:/etc/syslog-ng/syslog-ng.conf
3. Forwarding Logs from Devices
Most network devices support syslog. For example, a Cisco router:
logging host 192.168.1.10 transport udp port 514
On Linux clients:
*.* @192.168.1.10:514
On Windows, you can use NXLog or built-in Event Forwarding.
Enhancing Your Syslog Server
- Log rotation: Use
logrotate
to prevent disks from filling up. - Search: Index logs with ELK Stack.
- Dashboards: Try Graylog for visualization.
- Alerting: Send email or Slack notifications when certain log patterns appear.
Free Syslog Tools Compared
Tool | Pros | Cons |
---|---|---|
Rsyslog | Lightweight, default on Linux | Basic unless extended with plugins |
syslog-ng | Flexible, good filtering | Steeper learning curve |
Graylog | Web UI, dashboards, alerts | Requires MongoDB & Elasticsearch |
ELK Stack | Full observability platform | Heavy infrastructure |
NXLog | Great for Windows logs | Advanced features require license |
Challenges of Running Your Own Syslog Server
- Maintenance: Regular updates and patching required.
- Scaling: High log volumes demand tuning and clustering.
- Storage: Logs can consume terabytes quickly.
- Compliance: Meeting retention and audit requirements is complex.
- High Availability: You must design redundancy yourself.
Why LogCentral is Easier
While building your own syslog server is a great learning experience, most IT teams prefer simplicity. LogCentral provides:
- Instant Setup: No servers or configs required.
- Scalability: Handles millions of events automatically.
- Compliance Ready: Meets audit and retention needs.
- Dashboards & Alerts: Built-in visualization and notifications.
- Cross-Platform: Works with Linux, Windows, firewalls, and cloud.
If you enjoy tinkering, tools like Rsyslog and syslog-ng are excellent. But if you want enterprise-grade logging without the hassle, LogCentral is the smarter choice.
FAQ
Can I run a syslog server for free?
Yes. Tools like Rsyslog and syslog-ng are completely free and included in most Linux distributions.
What is the best free syslog server?
For simple setups, Rsyslog is best. For advanced filtering, syslog-ng. For visualization, Graylog or ELK Stack.
Can I build a syslog server with Docker?
Yes. Both syslog-ng and Graylog have Docker images for quick deployment.
Is Windows supported?
Windows does not include syslog, but you can use NXLog or forward logs to a Linux syslog server.
How much storage do I need?
Depends on log volume and retention. A medium environment may need several GB per day.
What’s the difference between Rsyslog and syslog-ng?
Both are syslog daemons. Rsyslog is lighter, syslog-ng offers more filtering and integrations.
Can I use TLS with syslog?
Yes. Both Rsyslog and syslog-ng support encrypted transport using TLS.
What are the risks of self-hosting?
Data loss, downtime, compliance issues, and scaling challenges are common risks.
Do I need a database?
Basic syslog servers don’t need one, but Graylog and ELK Stack require databases for indexing and search.
Why choose LogCentral over DIY?
LogCentral removes the burden of setup, scaling, and compliance, letting IT teams focus on security and operations.