Update logging + implement log rotation
See original GitHub issueObserved behavior
When kolibri starts, the following message is received:
INFO Going to daemon mode, logging to /home/benjamin/.kolibri/server.log
However server.log
is not the main log anymore.
Currently, we have:
kolibri.log
for general INFO level from Pythondebug.log
for general DEBUG level (if switched on?)server.log
for crash outputs when deamonized
Related issue: Icecube logging is noisy #2212
Changes to this have to be consolidated with docs.
Expected behavior
I would suggest the following naming for an easier user experience and for UIs that want to integrate a log view (highly recommended)
log/daemon.log
for sporadic crash output produced by the daemon and uncaught by other loggerslog/kolibri.log
for the latest log outputlog/kolibri-YYYY-MM-DD.log
for log rotation (dates provided kindly by built-in log rotation, see KA Lite)log/debug.log
for the latest debug output, not rotated to avoid accumulating huge logs
Icecube issue: Possibly solved by only logging Icecube progress etc. as debug output and accepting that it’s noisy.
User-facing consequences
Makes it easier to dig out logs and finalizes how we want to do logging so we don’t have to change it further down the road.
Readiness for UI implementation.
Means we can also amend the issue template regarding where to find the logs.
Updates
- ~Changed file extensions from
.log
to.txt
– will make it easier for users on Windows to open the files~. Moved: Follow-up from https://github.com/learningequality/kolibri/issues/2512 - ~Suggestion to put rotated log files in
log/archive/
to reduce user confusion~ Not easy to implement, needs modification of built-in Python logging class.
Issue Analytics
- State:
- Created 6 years ago
- Comments:31 (31 by maintainers)
Top Results From Across the Web
How to Setup and Manage Log Rotation Using Logrotate in ...
In this article, we will explain how to use logrotate to automatically rotate system logs, compress, remove, and mail logs on a periodic ......
Read more >How to Manage Log Files Using Logrotate - Datadog
Create or copy log files to manage rotation · Adjust your log rotation schedule · Compress files to save disk space · Run...
Read more >Setting up logrotate in Linux | Enable Sysadmin - Red Hat
Logs are rotated to keep log files tenable. Simply put, a new file is opened while the older one is closed and either...
Read more >Rotating Logs With Logrotate in Linux - Baeldung
In this tutorial, we'll be looking at the logrotate tool. Specifically, we'll learn how to automate log rotation using logrotate in Linux.
Read more >How to Use Logrotate to Manage Log Files in Linux
Learn how to use the Logrotate utility in Linux-based systems to set up automatic compression and deletion of older log records.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I concede that I found the patch release confusing and haven’t understood quite what the scope of 0.12.4 was, but let’s get this improvement out there to the users 🚢
0.12.y, not 0.12.x