Learn Docker With My Newest Course

Dive into Docker takes you from "What is Docker?" to confidently applying Docker to your own projects. It's packed with best practices and examples. Start Learning Docker →

Prevent Kdenlive from Producing Millions of Log Lines on Linux

prevent-kdenlive-from-producing-millions-of-log-lines-on-linux.jpg

We'll go over how to disable Kdenlive's noisy logs so when you run journalctl it's not overtaking your output.

Quick Jump:

When running Linux on the desktop, viewing your logs with journalctl is an important thing to be able to do to troubleshoot or debug something.

I noticed Kdenlive was saturating those logs. For reference I installed it with pacman on Arch Linux and I’m currently using version 26.04.2. I noticed the same issue with 25.X.X too. All that to say, maybe things change in the future!

After 6 months of running Arch Linux and editing 1 video per week, Kdenlive alone produced a million log lines taking up a few hundred megs of disk space.

I extracted those stats by running:

$ journalctl --identifier kdenlive | wc -l
997668

$ journalctl --identifier kdenlive | wc -c
101002082

For comparison, the entire system except Kdenlive produces ~604k lines and ~75 MB of disk space.

Here’s how I arrived at that:

$ journalctl --exclude-identifier kdenlive | wc -l
604680

$ journalctl --exclude-identifier kdenlive | wc -c
75804280

That’s pretty wild to me that Kdenlive being occasionally run produced almost 2x more logs than every single process and application running on my system for the entire duration of those 6 months since I leave my computer on 24 / 7.

It’s problematic because by default journald will only log up to 4 GB of logs before it starts deleting older logs. On my machine if I run journalctl --disk-usage it’s using ~850 MB which includes a lot of metadata not included in the wc -c output (which only adds up to ~175 MB).

You could say logs from a few years ago aren’t helpful and to be fair most of them aren’t, but if you’re trying to troubleshoot something, having them is helpful. Even after 6 months I still run into occasional things that I haven’t narrowed down yet where having historic logs will help.

You can always increase the disk space for journald but independent of that if I want to look at this boot’s logs using journalctl -b is handy. Having thousands or tens of thousands of Kdenlive logs mixed in makes viewing them tedious. Needing to remember to use --exclude-identifier|-T kdenlive is also mildly annoying.

# What’s Logged by Default?

Ultimately it boiled down to tons of debug, info and warnings.

There were hundreds of thousands of lines like this:

May 02 09:17:16 kaizen kdenlive[22008]: ----------
                                        -----------
                                        // ADJUSTING EFFECT LENGTH, LOGUNDO  true ,  0 / 231 - 18969 ,  18739
May 02 09:17:16 kaizen kdenlive[22008]: ----------
                                        -----------
                                        // ADJUSTING EFFECT LENGTH, LOGUNDO  true ,  231 / 231 - 416 ,  186
May 02 09:17:16 kaizen kdenlive[22008]: ----------
                                        -----------
                                        // ADJUSTING EFFECT LENGTH, LOGUNDO  true ,  231 / 417 - 18969 ,  18553
May 02 09:17:16 kaizen kdenlive[22008]: :::: CHECKING MIX  FOR:  22
May 02 09:17:16 kaizen kdenlive[22008]: :::: CLIP HAS NO END MIX... FIRST MIX: -1
May 02 09:17:16 kaizen kdenlive[22008]: loaded clip:  186 , ID:  22 , index:  1 , TYPE: 3
May 02 09:17:16 kaizen kdenlive[22008]: loaded clip with Astream:  1
May 02 09:17:16 kaizen kdenlive[22008]: // CHECKING REGROUP ELEMENT:  8 , ISCLIP:  false true
May 02 09:17:16 kaizen kdenlive[22008]: item not found
May 02 09:15:21 kaizen kdenlive[22008]: qrc:/qt/qml/org/kde/kdenlive/ClipAudioThumbs.qml:84:9: QML TimelineWaveform: Binding loop detected for property "waveOutPoint":
                                        qrc:/qt/qml/org/kde/kdenlive/ClipAudioThumbs.qml:97:13
May 02 09:15:21 kaizen kdenlive[22008]: qrc:/qt/qml/org/kde/kdenlive/ClipAudioThumbs.qml:84:9: QML TimelineWaveform: Binding loop detected for property "waveOutPoint":
                                        qrc:/qt/qml/org/kde/kdenlive/ClipAudioThumbs.qml:97:13
May 02 09:15:21 kaizen kdenlive[22008]: qrc:/qt/qml/org/kde/kdenlive/ClipAudioThumbs.qml:84:9: QML TimelineWaveform: Binding loop detected for property "waveOutPoint":
                                        qrc:/qt/qml/org/kde/kdenlive/ClipAudioThumbs.qml:97:13
May 02 10:14:24 kaizen kdenlive[22008]: ======= REQUESTING NEW CLIP SIZE:  140 , ON TID:  4
May 02 10:14:24 kaizen kdenlive[22008]: ======= ADJUSTED NEW CLIP SIZE:  140  FROM  150
May 02 10:14:24 kaizen kdenlive[22008]: ======= REQUESTING NEW CLIP SIZE:  136 , ON TID:  4

If you were a developer of Kdenlive or any of its plugins, having these logs would be very helpful but as an end user I’m mainly curious about seeing errors so I can troubleshoot something that’s not working as expected and potentially report bugs.

# Only Logging Kdenlive Errors

There’s a couple of ways to approach this but I landed on wrapping the kdenlive binary and disabling Qt logs for everything but errors.

If you’re using DotFriedRice you already have this enabled by default. If you’re using not it…

You can create ~/.local/bin/kdenlive (make sure ~/.local/bin is on your PATH) and put in:

#!/usr/bin/env bash

export QT_LOGGING_RULES="*.debug=false;*.info=false;*.warning=false"

exec /usr/bin/kdenlive "$@"

Since Kdenlive uses Qt for its GUI, we’re configuring Qt to disable everything but error logs. Technically you could set this environment variable for all Qt apps in a different way but Kdenlive is the only app on my system with super noisy logs so I scoped it to Kdenlive for now.

Once that’s set up you should notice no more logs unless Kdenlive throws an error. I applied this on May 30th and I haven’t seen a single log line from Kdenlive since then.

The video below shows the before and after.

# Demo Video

Timestamps

  • 0:34 – Showing all of the logs
  • 1:06 – Counting the log lines and size
  • 2:13 – Your system logs are important
  • 2:36 – Disabling specific Qt log levels
  • 3:46 – You could apply this to other Qt apps too

Did you end up doing this? Let me know below.

Never Miss a Tip, Trick or Tutorial

Like you, I'm super protective of my inbox, so don't worry about getting spammed. You can expect a few emails per year (at most), and you can 1-click unsubscribe at any time. See what else you'll get too.



Comments