There are two log file (tracker-server.log and wrapper.log). Which one are you talking about? By the way, both of them roll out every day, so you can remove old files if you don't need them.
how can I stop creating the log file ?
Remove it from the config.
thank you. I have another question:
what are my options for logger.level=?
the documentation shows only 'all' option; are there any other options?
thank you
You can find all available options here:
https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html
Is it possible to configure to automatically delete rolled out files older than x days?
There's no such option in Traccar, but you can always create a simple cron task to do it.
There is an example on how to automatically get rid of old logs here: https://www.traccar.org/clear-history/
However, if you want to keep logs for a longer period of time and still minimize disk usage, then logrotate is your friend. Here's how I set it up - customize it to your own needs:
/opt/traccar/logs/tracker-server.log {
rotate 52
size 1G
weekly
compress
notifempty
lastaction
systemctl restart traccar
endscript
}
<entry key='logger.enable'>true</entry>
<entry key='logger.level'>info</entry>
<entry key='logger.file'>./logs/tracker-server.log</entry>
<entry key='logger.rotate'>false</entry>
One wish list item I have for this - or maybe there is a way already: force traccar to close and re-create the log file without a full restart.
Similar to how it is described here: https://github.com/log4js-node/log4js-node/issues/343
Currently sending HUP signal fully restarts traccar.
Feel free to create a ticket or send a pull request.
Thanks, done: https://github.com/traccar/traccar/issues/4878
@socket that was a big help to clear log files after 30 days. I looked at the db clearing (mine is 2GB+), but my server is using H2 DB. Any ideas on that? I think I tried doing a vacuum on it with little success, and had chatted with Anton a bit. If not, any way to convert to Mysql? (mostly how would I export all vehicles, geofences, and notifications? Thanks
There are some threads on the forum about converting H2 to MySQL. I think someone even posted a step by step guide for it.
Thanks Anton. Is there a way to export my main configuration data and just start fresh by importing?
What do you mean by main configuration?
Hello,
Is it possible to have a limit size of the log file ?
Thanks.