Traccar not logging to tracker_service.log (dbms related???)

Tony Shelver6 years ago

I posted earlier about Traccar not starting up when I use Postgres. Version is the latest download (4.3) running on Ubuntu 18.04.
Several people have already offered suggestions on that thread.

The first thing I need to solve is why Traccar isn't logging anything to tracker_service.log when I start it. If I had that, i could start to follow the trail. At the moment, I am just spitting in the wind.

When using the standard install (h2), it works fine. Installation as per https://www.traccar.org/linux/. System logs, and I can get into the system (looks great by the way)

I have tried changing the traccar.xml file to point to Postgresql and last night to MySQL (current version MariaDB), but nothing at all gets logged.

I would expect a log so that at least I can debug further, even if there is an error in my data access configuration. Am I missing something?

For what it's worth, the db stuff follows.
In both cases, I can connect directly using the traccar user to the traccar database / schema using other tools such as MySQL workbench and LibreOffice Base (not using the jdbc driver for Postgres through).

Ernesto suggested possibly a permissions issue. MySQL was installed under root, and traccar is running under root as well. Access is to a created traccar database / schema, and a traccar account with full DBA privileges.

I don't think this is the cause of the logging issue, but here are the changes to traccar.xml for MariaDB/MySQL.

<entry key='database.driver'>com.mysql.jdbc.Driver</entry>
    <entry key='database.url'>jdbc:mysql://localhost:3306/traccar?useSSL=false;allowMultiQueries=true;autoReconnect=true;useUnicode=yes;characterEncoding=UTF-8;sessionVariables=sql_mode=''</entry>
    <entry key='database.user'>traccar</entry>
    <entry key='database.password'>pswd</entry>

And here are the changes for Postgresql:

 <entry key='database.driver'>org.postgresql.Driver</entry>
    <entry key='database.url'>jdbc:postgresql://127.0.0.1:5432/traccar</entry>
    <entry key='database.user'>traccar</entry>
    <entry key='database.password'>pswd</entry>

Thanks in advance :)

Anton Tananaev6 years ago

If you don't see any logs, most likely it means that your config is an invalid XML file.

Tony Shelver6 years ago

Thanks Anton. Decided to retry:
Stop traccar
Uninstall traccar
Remove the /opt/traccar directory.

Reinstall traccar
Start with h2 db: result is entries in log file. Client starts in browser.

Stop traccar
Edit (after saving to backup) traccar.xml as follows:

    <entry key='database.driver'>org.postgresql.Driver</entry>
    <entry key='database.url'>jdbc:postgresql://127.0.0.1:5432/traccar</entry>
    <entry key='database.user'>traccar</entry>
    <entry key='database.password'>password</entry>

I know a bit about xml, unfortunately it doesn't display here. All the tags were left as is, starting and ending correctly.
I cut and pasted the entire entry here, including the xml, so if it was incorrectly formatted, in theory it would display incorrectly here.

Tony Shelver6 years ago

Problem solved! many thanks and some apologies to Anton.

It's possible this go round i was too fast to check things out, and the service took a while to start to register.