This is a plugin for SA:MP that blocks logging to server_log.txt
.
It uses Zeex/subhook to hook logprintf
and redirect it to a function that does
the printf
without the log
.
Why would you want to block logging to server_log.txt
?
RCON can be used to read information being written to logs via a vulnerability
in the existing logprintf
implementation. This plugin protects you from this
vulnerability.
You should never log sensitive information anyway however logs being available to outsiders is still not desirable.
Because individual log files are not
- scalable
- easily managable
- portable
It's also not standard for a Linux app to log to STDOUT and a file. If I want to log to a file, I'd just pipe it.
This also removes the IO overhead of writing to the log file - which happens on the main thread.
With this plugin loaded, all your output comes out of STDOUT and you can do as you please with it:
- use maddinat0r/samp-log
- send to a logging service (see below)
- watch for "error", "warning", "debug" and send an Email or Discord message to alert your team to issues
- pipe it to /dev/null and live life on the edge
Logging is important and there are entire infrastructures dedicated to handling application logs. SA:MP can take advantage of these tools too.
For the oldschool sysadmins, syslog is probably what you are used to. Since SA:MP outputs via stdout, you can easily set up a standard systemd unit file and use journald to manage your logs.
If you're interested in accessing logs frequently for administration or market research purposes, I'd highly recommend the "ELK Stack". It gets the name from the technologies it uses: Elasticsearch, Logstash and Kibana.
An alternative to this would be using Prometheus and Grafana with a custom node exporter for SA:MP data.