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

Store logs in /var/log #7979

Merged
merged 6 commits into from
Apr 15, 2024
Merged

Store logs in /var/log #7979

merged 6 commits into from
Apr 15, 2024

Conversation

zrhoffman
Copy link
Member

@zrhoffman zrhoffman commented Apr 2, 2024

This PR

  • changes configuration to log Traffic Router to /var/log/traffic_router instead of /opt/traffic_router/var/log
  • changes configuration to log Traffic Monitor to /var/log/traffic_monitor instead of /opt/traffic_monitor/var/log
  • changes configuration to log Traffic Stats to /var/log/traffic_stats instead of /opt/traffic_stats/var/log

so that the logs are on a different partition than the application itself.


Which Traffic Control components are affected by this PR?

  • Documentation
  • Traffic Monitor
  • Traffic Router
  • Traffic Stats
  • CDN in a Box
  • Automation - Ansible roles
  • unknown

What is the best way to verify this PR?

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

PR submission checklist

@zrhoffman zrhoffman added bug something isn't working as intended Traffic Router related to Traffic Router logging related to logging infrastructure labels Apr 2, 2024
@codecov-commenter
Copy link

codecov-commenter commented Apr 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

❗ 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
@@            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 Coverage Δ
traffic_router_unit 29.03% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@zrhoffman zrhoffman added Traffic Stats related to Traffic Stats Traffic Monitor related to Traffic Monitor Traffic Server related to Apache Traffic Server Traffic Ops related to Traffic Ops labels Apr 2, 2024
@zrhoffman zrhoffman removed Traffic Server related to Apache Traffic Server Traffic Ops related to Traffic Ops labels Apr 2, 2024
@zrhoffman zrhoffman changed the title Store Traffic Router logs in /var/log/traffic_router Store logs in /var/log Apr 3, 2024
@ntheanh201
Copy link
Contributor

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

Copy link
Contributor

@jagan-parthiban jagan-parthiban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After running Dev CIAB on the PR code, couldn't find the log files either at /opt/traffic_router/var or /var/log/. Also couldn't find the log file in TM container as well.

/opt/traffic_router/var # 
/opt/traffic_router/var # ls -l
total 0
drwxr-x---    4 root     root           128 Apr  4 05:19 auto-zones
/opt/traffic_router/var # cd /var/log/
/var/log # ls -l
total 0

@zrhoffman
Copy link
Member Author

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

"log_location_access": "$TM_LOG_ACCESS",
"log_location_event": "$TM_LOG_EVENT",
"log_location_error": "$TM_LOG_ERROR",
"log_location_warning": "$TM_LOG_WARNING",
"log_location_info": "$TM_LOG_INFO",
"log_location_debug": "$TM_LOG_DEBUG",

TM_LOG_ACCESS=stdout
TM_LOG_EVENT=stdout
TM_LOG_ERROR=stdout
TM_LOG_WARNING=stdout
TM_LOG_INFO=stdout
TM_LOG_DEBUG=stdout

@zrhoffman zrhoffman merged commit f449e50 into apache:master Apr 15, 2024
18 checks passed
@zrhoffman zrhoffman deleted the tr-var/log branch April 15, 2024 16:33
@ericholguin ericholguin mentioned this pull request Apr 17, 2024
4 tasks
@zrhoffman zrhoffman added the high impact impacts the basic function, deployment, or operation of a CDN label Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something isn't working as intended high impact impacts the basic function, deployment, or operation of a CDN logging related to logging infrastructure Traffic Monitor related to Traffic Monitor Traffic Router related to Traffic Router Traffic Stats related to Traffic Stats
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants