User Log • Clear after X time [setting]

03b

New member
Need a way to keep the User Log from getting too big.

In my case I'd like it to auto remove entries older than 72 hours. This way I always have a 3-day history.

Right now I have to remember to clear the log every couple of days, it is becoming a chore. 😅
 

Jacob L

Moderator (Lawsonator)
Why not use the clear log action and an interval trigger.

You can also set number of log lines in MacroDroid settings
 

03b

New member
Why not use the clear log action and an interval trigger.

I need the last 3 days of history to always be available. Clearing the log wipes everything. But at least it is better than doing it manually.

You can also set number of log lines in MacroDroid settings

I noticed this, but does that apply to the user log? Or only the system log? Because it is a system log setting. Also, the lowest is 10k lines which is too much. That would keep over a month history in my user log. I need 3 days or around 3 days. If I can set to 500 lines, would be good. But System log and User log need different settings. Not the same.
 

Jacob L

Moderator (Lawsonator)
I need the last 3 days of history to always be available. Clearing the log wipes everything. But at least it is better than doing it manually.



I noticed this, but does that apply to the user log? Or only the system log? Because it is a system log setting. Also, the lowest is 10k lines which is too much. That would keep over a month history in my user log. I need 3 days or around 3 days. If I can set to 500 lines, would be good. But System log and User log need different settings. Not the same.
In which case, the day/time trigger might be better. You're right about the system log to user log thing
 

Quidn

Passionate Member
I need the last 3 days of history to always be available. Clearing the log wipes everything. But at least it is better than doing it manually.



I noticed this, but does that apply to the user log? Or only the system log? Because it is a system log setting. Also, the lowest is 10k lines which is too much. That would keep over a month history in my user log. I need 3 days or around 3 days. If I can set to 500 lines, would be good. But System log and User log need different settings. Not the same.

What about using Write to File action rather than User Log?

As you might already know, periodic log rotation in filesystem and then purge outdated is very common way.

It can be done by MacroDroid relatively easily than average traditional server daemons, by using magic texts in filename.

Logs in filesystem would be accessed from other applications in general, and there are some tricks if that's a concern.

Saving in Array/Dictionary or even string variable might be an alternative, depending on what and how much you log and why you want to purge outdated.

If it's because of just "to prevent getting to big", then filesystem log will makes sense in several perspectives I think.
 
Top