log system

Adrien5 years ago

hi,
how to have the old system of logs that is to say a log file per day. I think this system was optimal.I don't think it's wise to have a single log file.

Anton Tananaev5 years ago

Traccar does daily log files by default. Nobody is changing anything.

Adrien5 years ago

hi.
at home, in the current version, all actions are traced in a single log file while in the previous version of traccar, I had a log file per day.
this is the contents of my log file. the data of yesterday and those of today are in the same file.

2019-01-17 13:26:08  INFO: Version: null
2019-01-17 13:26:08  INFO: Starting server...
2019-01-17 13:26:09  INFO: jetty-9.4.12.v20180830; built: 2018-08-30T13:59:14.071Z; git: 27208684755d94a92186989f695db2d7b21ebc51; jvm 1.8.0_192-b12
2019-01-17 13:26:09  INFO: Started o.t.w.@1fcf9739{/,null,AVAILABLE}
2019-01-17 13:26:09  INFO: DefaultSessionIdManager workerName=node0
2019-01-17 13:26:09  INFO: No SessionScavenger set, using defaults
2019-01-17 13:26:09  INFO: node0 Scavenging every 600000ms
2019-01-17 13:26:09  INFO: Started o.e.j.s.ServletContextHandler@2c2a027c{/,null,AVAILABLE}
2019-01-17 13:26:09  INFO: Started ServerConnector@3664f108{HTTP/1.1,[http/1.1]}{0.0.0.0:8082}
2019-01-17 13:26:10  INFO: Started @4815ms
2019-01-17 13:27:13  INFO: user: 1, action: login
2019-01-17 13:33:17  INFO: user: 1, action: edit, object: server, id: 1
2019-01-17 13:40:19  INFO: user: 1, action: edit, object: user, id: 1
2019-01-17 13:45:55  INFO: user: 1, action: edit, object: user, id: 1
2019-01-17 14:49:36  INFO: user: 1, action: logout
2019-01-18 08:54:03  INFO: HikariPool-1 - Starting...
2019-01-18 08:54:03  INFO: HikariPool-1 - Start completed.
2019-01-18 08:54:04  INFO: Clearing database change log checksums
2019-01-18 08:54:04  INFO: SELECT COUNT(*) FROM geofleet.DATABASECHANGELOGLOCK
2019-01-18 08:54:04  INFO: SELECT COUNT(*) FROM geofleet.DATABASECHANGELOGLOCK
2019-01-18 08:54:04  INFO: SELECT `LOCKED` FROM geofleet.DATABASECHANGELOGLOCK WHERE ID=1
2019-01-18 08:54:04  INFO: Successfully acquired change log lock
2019-01-18 08:54:04  INFO: SELECT MD5SUM FROM geofleet.DATABASECHANGELOG WHERE MD5SUM IS NOT NULL LIMIT 1
2019-01-18 08:54:04  INFO: UPDATE geofleet.DATABASECHANGELOG SET MD5SUM = NULL
Evgeny5 years ago

Hi!
Are you using a version of git?

Adrien5 years ago

yes

Evgeny5 years ago

Hm... The option to disable log rotation has recently been added for logrotate compatibility, but the default behavior should not have changed.
Please try add this line in you configuration file:

<entry key='logger.rotate'>true</entry>
Adrien5 years ago

this option is already there but the platform only writes in one log file. I'm using Netbeans 8.0 to compile the project.

Evgeny5 years ago

Can you provide your default.xml and traccar.xml? I will once again test the behavior of the log rotation system.

Adrien5 years ago

hi,
I send you to which address?

Evgeny5 years ago
Evgeny5 years ago

Received.

Evgeny5 years ago

Alas, on a clean build from git with default configuration or your configs, the problem could not be reproduced.
Please try build and install the latest version from git and replacing the parameters in traccar.xml with the ones you need.

My logs with default configs:

tracker-server.log  tracker-server.log.20190118  tracker-server.log.20190119

P.S.
Tested on Linux host.
P.P.S.
The logger.rotate parameter is already contained in the latest version of default.xml.