How to control system_logs.idb

I can’t tell which of the logging sub-systems is generating the /var/log/ignition/system_logs.idb file.

I’m not finding any reference to it in ignition.conf or log4j.properties. Where and how can I adjust the max size/entry limits? Can I make it split automatically w/o restarting Ignition?

Also, why am I finding ignition.conf in both /etc/ignition and /var/lib/ignition/data? Which takes precedence?

The system_logs.idb file is (mostly) controlled by the logback.xml file in the data/ directory; there should be some commented out lines you can use to change maintenance settings, but you can’t configure it to “roll” like you can the wrapper.log files - it’s designed specifically to create and maintain a single database file. Also, any changes made would require an Ignition restart to take effect.

etc/ignition/ignition.conf should be a symlink to /var/lib/ignition/data/ignition.conf. Try ls -L to confirm.

Right idea, wrong direction. The files over in /var/lib/ignition/data are symbolic links back to /etc/ignition on my system. I should've been able to figure that out on my own. Thank you for the hint.

For logback, am I correct in thinking I should be using this documentation for help configuring it: Chapter 3: Configuration

No. That logback documentation is too low-level. I think I can only use those four fields that are commented right there in logback.xml. On the “minTimeBetweenMaintenance” field, is that in seconds?

Milliseconds.

    protected int entryLimit = 50000;
    //The number of times to perform deletions before performing a vacuum.
    protected int vacuumFrequency = 3;
    //Max events puts a cap on how many events can happen (the lesser of this and entryLimit will be used) before
    // maintenance is performed
    protected long maxEventsPerMaintenance = 5000;
    //However, min time puts a cap on frequency. It takes precedence over max_events.
    protected long minTimeBetweenMaintenance = 60000;
1 Like

Last week I un-commented that block in logback.xml and restarted my gateway. My output sqlite db is still growing…

I searched through the wrapper log for any hints that it was doing anything. I’m not seeing any references to “logback” since I started the gateway. I see “Starting logfile maintenance” only once right after starting the gateway, but not again since.

I do see log lines implying that logback is loading the file I edited in /var/lib/ignition/data/logback.xml, but no indication that the configuration variables I added are being used.

Any hints on how to tell if the config file is being loaded properly or is doing what it’s supposed to?

Are you getting a Scheduling logfile maintenance. Last maintenance: %s, events since then: %s in the logs?

It looks like the calculation for logfile maintenance is done whenever records are added, so the check for whether to run maintenance could have not been met yet?

Looks like that might be it. I’ll give it more time and check again later.

ignition@dev-ignition1:/var/log/ignition$ grep "Scheduling" wrapper.log
INFO   | jvm 1    | 2020/01/21 04:22:13 | Scheduling logfile maintenance. Last maintenance: Tue Jan 21 04:21:12 UTC 2020, events since then: 47900
INFO   | jvm 1    | 2020/01/22 21:48:02 | Scheduling logfile maintenance. Last maintenance: Thu Jan 01 00:00:00 UTC 1970, events since then: 0
INFO   | jvm 1    | 2020/01/28 15:39:34 | Scheduling logfile maintenance. Last maintenance: Thu Jan 01 00:00:00 UTC 1970, events since then: 0
INFO   | jvm 1    | 2020/02/08 13:31:57 | Scheduling logfile maintenance. Last maintenance: Tue Jan 28 15:39:34 UTC 2020, events since then: 5001
INFO   | jvm 1    | 2020/02/13 15:38:32 | Scheduling logfile maintenance. Last maintenance: Thu Jan 01 00:00:00 UTC 1970, events since then: 0
INFO   | jvm 1    | 2020/02/24 18:12:57 | Scheduling logfile maintenance. Last maintenance: Thu Feb 13 15:38:32 UTC 2020, events since then: 5001
INFO   | jvm 1    | 2020/02/24 18:14:08 | Scheduling logfile maintenance. Last maintenance: Thu Jan 01 00:00:00 UTC 1970, events since then: 0
INFO   | jvm 1    | 2020/02/24 21:00:13 | Scheduling logfile maintenance. Last maintenance: Thu Jan 01 00:00:00 UTC 1970, events since then: 0
2 Likes

Would you please mention how did you get this file? I would like to have a file with all the usernames who logged in and also made some changes. I think this information would be useful.

I think Audit logs is what you are looking for. https://docs.inductiveautomation.com/display/DOC81/Audit+Log+and+Profiles

1 Like

Very helpful. Thank you.