apache / trafficcontrol

Apache Traffic Control is an Open Source implementation of a Content Delivery Network
https://trafficcontrol.apache.org/
Apache License 2.0
1.02k stars 339 forks source link

Store logs in /var/log #7979

Closed zrhoffman closed 2 months ago

zrhoffman commented 3 months ago

This PR


## Which Traffic Control components are affected by this PR?

What is the best way to verify this PR?

If this is a bugfix, which Traffic Control versions contained the bug?

PR submission checklist

codecov-commenter commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 65.77%. Comparing base (26a2f6a) to head (900cf16). Report is 6 commits behind head on master.

:exclamation: Current head 900cf16 differs from pull request most recent head 72834a2. Consider uploading reports for the commit 72834a2 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #7979 +/- ## ========================================= Coverage 65.77% 65.77% Complexity 98 98 ========================================= Files 327 327 Lines 13010 13010 Branches 998 998 ========================================= Hits 8557 8557 Misses 4091 4091 Partials 362 362 ``` | [Flag](https://app.codecov.io/gh/apache/trafficcontrol/pull/7979/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | |---|---|---| | [traffic_router_unit](https://app.codecov.io/gh/apache/trafficcontrol/pull/7979/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `29.03% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

ntheanh201 commented 3 months ago

+1 this idea, it would be better for the logs agent's permissions

zrhoffman commented 2 months ago

After running Dev CIAB on the PR code, couldn't find the log files either at /opt/traffic_router/var or /var/log/.

The TR logs show up for me in /var/log/traffic_router.

[root@trafficrouter traffic_router]# ls -l
total 76
-rw-r--r-- 1 root root     0 Apr 10 18:52 access.log
-rw-r--r-- 1 root root 73560 Apr 10 18:55 traffic_router.log
[root@trafficrouter traffic_router]# tail -f access.log

They also show up for docker-compose logs -f trafficrouter.

Also couldn't find the log file in TM container as well.

The TM logs are printed to stdout only with no files

https://github.com/apache/trafficcontrol/blob/900cf169757b007e106ecdf112f9c520fbdd7635/infrastructure/cdn-in-a-box/traffic_monitor/traffic_monitor.cfg#L8-L13

https://github.com/apache/trafficcontrol/blob/900cf169757b007e106ecdf112f9c520fbdd7635/infrastructure/cdn-in-a-box/variables.env#L76-L81