Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change log for UDP tracker #549

Merged

Conversation

josecelano
Copy link
Member

@josecelano josecelano commented Dec 22, 2023

Changed log lines format for the UDP tracker:

From:

2023-12-22T12:32:53.016911160+00:00 [torrust_tracker::servers::udp::server][INFO] Received 109 bytes
2023-12-22T12:32:53.016953899+00:00 [torrust_tracker::servers::udp::server][INFO] Sending 43 bytes ...
2023-12-22T12:32:53.017038257+00:00 [torrust_tracker::servers::udp::server][INFO] 43 bytes sent

To:

2023-12-22T12:35:51.320114322+00:00 [UDP][INFO] "CONNECT TxID 1583189312"
2023-12-22T12:35:51.345003905+00:00 [UDP][INFO] "ANNOUNCE TxID 1583189313 IH 443c7602b4fde83d1154d6d9da48808418b181b6"
2023-12-22T12:35:51.320114322+00:00 [UDP][INFO] "SCRAPE TxID 1583189312"
  • The target is more generic "UDP" and it will be always the same even if we rearrange the packages.
  • The info is more useful. It includes the request type, the transaction ID to identify the client, and the info-hash. That would allow us to extract statistics from the logs.

NOTE:

In the long term maybe this should be configurable.

@josecelano josecelano linked an issue Dec 22, 2023 that may be closed by this pull request
@josecelano
Copy link
Member Author

josecelano commented Dec 22, 2023

I've changed my mind regarding the tracker log's verbosity. This change makes the log files even bigger. I solved the problem of running out of disk with "limit" attributes for the logs in the compose file.

logging:
  options:
    max-size: "10m"
    max-file: "10"

And I think the new format is very useful for fixing bugs and extracting statistics from logs.

@josecelano josecelano force-pushed the issue-539-decrease-logs-verbosity branch from dde5454 to aaca370 Compare December 22, 2023 12:46
@josecelano josecelano requested review from mickvandijke and da2ce7 and removed request for da2ce7 December 22, 2023 12:47
From:

```s
2023-12-22T12:32:53.016911160+00:00 [torrust_tracker::servers::udp::server][INFO] Received 109 bytes
2023-12-22T12:32:53.016953899+00:00 [torrust_tracker::servers::udp::server][INFO] Sending 43 bytes ...
2023-12-22T12:32:53.017038257+00:00 [torrust_tracker::servers::udp::server][INFO] 43 bytes sent
```

To:

```s
2023-12-22T12:35:51.320114322+00:00 [UDP][INFO] "CONNECT TxID 1583189312"
2023-12-22T12:35:51.345003905+00:00 [UDP][INFO] "ANNOUNCE TxID 1583189313 IH 443c7602b4fde83d1154d6d9da48808418b181b6"
2023-12-22T12:35:51.320114322+00:00 [UDP][INFO] "SCRAPE TxID 1583189312"
````

- The target is more generic "UDP" and it will be always the same even if we rearrange the packages.
- The info is more useful. It includes the request type, the transaction ID to identify the client, and the info-hash. That would allow us to extract statistics from the logs.

NOTE:

In the long term maybe this should be configurable.
@josecelano josecelano force-pushed the issue-539-decrease-logs-verbosity branch from aaca370 to 6e607c3 Compare December 22, 2023 12:52
Copy link

codecov bot commented Dec 22, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (20b052d) 79.57% compared to head (ff3928e) 79.58%.

Files Patch % Lines
src/servers/udp/server.rs 66.66% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #549   +/-   ##
========================================
  Coverage    79.57%   79.58%           
========================================
  Files          117      117           
  Lines         7747     7750    +3     
========================================
+ Hits          6165     6168    +3     
  Misses        1582     1582           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@josecelano
Copy link
Member Author

ACK ff3928e

@josecelano josecelano merged commit 2b859d6 into torrust:develop Dec 22, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Tracker logs are too verbose
1 participant