volttron

volttron log file management best practices


Is there a way to limit the size of the volttron.log file? At the moment I can see that is a couple gigs in size and it makes less crash when trying to find something to troubleshoot.

Is it possible to use like a CRON service or something that could run just to keep like 2 days worth of data? I dont think I would need any more than that. Or does volttron have anything out of the box for file management?


Solution

  • When starting volttron you can set up a rotating log file.

    In the "./start-volttron" script (https://github.com/VOLTTRON/volttron/blob/main/start-volttron) there is a command that uses a log definition file.

    volttron -L examples/rotatinglog.py > volttron.log 2>&1 &
    

    By default this examples/rotatinglog.py file has a weekly log retention and changes the log each 24hr period.