question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update logging + implement log rotation

See original GitHub issue

Observed 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 Python
  • debug.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 loggers
  • log/kolibri.log for the latest log output
  • log/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:closed
  • Created 6 years ago
  • Comments:31 (31 by maintainers)

github_iconTop GitHub Comments

2reactions
benjaomingcommented, May 24, 2019

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 🚢

1reaction
indirectlylitcommented, May 23, 2019

the PR was targeted for 0.12.x

0.12.y, not 0.12.x

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found