Enable new log report feature

Adriano Miranda 2 years ago

Hello everyone,

I recently installed Traccar version 5.11, but I can't view any logs from the "Reports > Logs" page.

There is a specific parameter or setting that needs to be activated in order to display the logs correctly?

Thanks.

Anton Tananaev 2 years ago

No configuration needed. If you don't see anything there, it probably means there's nothing to display.

Track-trace 2 years ago

@Adriano It confused me also at first.

It will only start showing log entrys from the moment that you open the report/log page. So no historical log entry's but device data that comes in after you opened that reports/log page (and only as long als you keep that log page open).

Adriano Miranda 2 years ago

@Anton, Understood. Could you please inform me what kind of data I should expect to see there, so I can perform some tests?

Anton Tananaev 2 years ago

Only incoming device data.

Track-trace 2 years ago

It will show the actual HEX that the device send (the same as in traccar log file). And it will also show that for unknown devices. Its a nice feature.

Adriano Miranda 2 years ago

I am currently receiving data from at least 95 devices, and I can see the information in the application's log, but I don't see anything on the web.

Anton Tananaev 2 years ago

You should check 2 things:

  1. Make sure WebSocket connection is ok
  2. Make sure your user has access to those devices
Adriano Miranda 2 years ago

@Track-trace, thanks for your answers.

@Anton,

  1. I see through Chrome that there is an error with the WebSocket. However, this same error is not affecting other web tasks as everything is functioning normally; only the log isn't loading.

    WebSocket Error

  2. Yes, this user is an administrator and has access to all devices.

Anton Tananaev 2 years ago

It is affecting other tasks. You won't have live tracking if WebSocket connection is not working.

Most likely you haven't configure WebSocket proxy properly.

Adriano Miranda 2 years ago

Thank you Anton, you're correct.

I managed to resolve it by adjusting the Nginx configuration. Here's a general outline of the changes that worked for me:

  • HTTP to HTTPS Redirection:
   server {
       listen 80;
       server_name yourdomain.com; # Replace with your domain

       return 301 https://$host$request_uri;
   }
  • Configure WebSocket in the SSL Block:
    In the server block that listens on port 443 for SSL, add specific settings for WebSocket.
server {
    listen 443 ssl;
    server_name yourdomain.com; # Replace with your domain

    # ... SSL configuration ...

    location / {
        proxy_pass http://localhost:PORT; # Replace with your Traccar server address and port
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        # WebSocket specific
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";

        # Long timeout for WebSocket connections
        proxy_read_timeout 7200s;
        proxy_connect_timeout 7200s;
    }
}
  • Reload Nginx Configuration.
Track-trace 2 years ago

Actually now i noticed that incoming device data that is filtered is not shown in reports/log

If the intend of the report/log is to use it also for troubleshooting / debugging it might be handy to see that data also (meaby with a different color that it is filtered).

Anton Tananaev 2 years ago

Actually now i noticed that incoming device data that is filtered is not shown in reports/log

This is incorrect assumption. Filtered data is shown in the report logs.

Track-trace 2 years ago

Yes you are correct Anton. Should have tested better.