torrust / torrust-tracker

A modern and feature-rich (private) BitTorrent tracker.
https://torrust.com
GNU Affero General Public License v3.0
348 stars 39 forks source link

Implement Logging Using RFC 5424 Syslog Format #387

Open da2ce7 opened 1 year ago

da2ce7 commented 1 year ago

Implement Logging

Enhance the program's logging functionality by adopting the RFC 5424 syslog format. This format ensures structured, consistent log entries that align with industry best practices. Follow these steps to implement the update:

Integrate RFC 5424 Format:

Revise the logging mechanism to adhere to the RFC 5424, ensuring each log entry includes priority level, timestamp, hostname, program name, and structured data when applicable.

Manage Severity Levels:

Implement the recommended severity levels (e.g., emergency, alert, warning, notice, info, debug) to accurately reflect the importance of log messages.

Configure Log Rotation:

Develop a log rotation strategy to control log file size and retention, preventing excessive disk space consumption.

Define Log Directory:

Designate a dedicated directory (e.g., /var/log/torrust/tracker) for log files, maintaining alignment with Linux directory structure conventions.

Enforce Permissions:

Apply appropriate permissions and ownership to log files and directories to ensure authorized access and modification.

Dynamic Log Levels:

Enable log level configuration (e.g., INFO, DEBUG, ERROR) to control verbosity based on configuration settings.

Test and Document:

Thoroughly test the updated logging mechanism, verifying adherence to RFC 5424 and proper handling of structured data. Document the changes for clarity.

Expected Outcomes:

josecelano commented 3 months ago

Relates to: https://github.com/torrust/torrust-demo/issues/4