You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by GitBox <gi...@apache.org> on 2021/06/04 08:51:51 UTC

[GitHub] [trafficserver] lukenowak opened a new issue #7922: Rotated squid.log files have hostname coming from request

lukenowak opened a new issue #7922:
URL: https://github.com/apache/trafficserver/issues/7922


   My `etc/trafficserver/logging.yaml` is:
   
   ```
   formats:
     - name: squid
       format: '%<cqtq> %<ttms> %<chi> %<crc>/%<pssc> %<psql> %<cqhm> %<cquc> %<cluc> %<caun> %<phr>/%<shn> %<psct>'
   logs:
     - filename: squid
       format: squid
       mode: ascii
       rolling_enabled: 1
       rolling_interval_sec: 10
       rolling_offset_hr: 0
   ```
   
   (the small `rolling_interval_sec` is to see the issue) and I see that it uses rotated filename like:
   
   `squid.log_www.example.com.20210604.10h28m50s-20210604.10h29m30s.old
   `
   
   Where `www.example.com` is just on of sites being served via Trafficserver.
   Instead of usual:
   
   `squid.log_HOST.IP.V.4.20210604.10h28m50s-20210604.10h29m30s.old
   `
   (it was like with with ATS 8).
   
   I tried to set:
   
   `CONFIG proxy.config.log.hostname STRING justit
   `
   To have:
   
   `squid.log_justit.20210604.10h28m50s-20210604.10h29m30s.old
   `
   
   But it seemed to be ignore during rotation.
   
   The rest of `config.log` from `records.config` are:
   
   ```
   CONFIG proxy.config.log.logging_enabled INT 3
   CONFIG proxy.config.log.max_space_mb_for_logs INT 25000
   CONFIG proxy.config.log.max_space_mb_headroom INT 1000
   CONFIG proxy.config.log.rolling_enabled INT 1
   CONFIG proxy.config.log.rolling_interval_sec INT 86400
   CONFIG proxy.config.log.rolling_size_mb INT 10
   CONFIG proxy.config.log.auto_delete_rolled_files INT 1
   CONFIG proxy.config.log.periodic_tasks_interval INT 5
   ```
   
   Which are correctly overridden in `etc/trafficserver/logging.yaml`
   
   Trafficserver version used is 9.0.1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] bneradt commented on issue #7922: Rotated squid.log files have hostname coming from request

Posted by GitBox <gi...@apache.org>.
bneradt commented on issue #7922:
URL: https://github.com/apache/trafficserver/issues/7922#issuecomment-861684787


   Thank you for filing the issue. I'll look into this.
   
   In case it's helpful, starting from 9.1.x, ATS supports external log rotation utilities (such as [logrotate](https://linux.die.net/man/8/logrotate)) via the SIGUSR2 signal:
   https://docs.trafficserver.apache.org/en/9.1.x/appendices/command-line/traffic_manager.en.html?highlight=sigusr2#signals
   
   Thus, logrotate can be configured to rotate the logs and send a SIGUSR2 to the traffic_manager process which will then re-open its file descriptors. We (Yahoo!) are using logrotate and SIGUSR2 to handle log rotation.
   
   I mention this in case it's helpful to plan ahead for when you move to 9.1.x. In the meantime I'll look into the issues you reported here.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] bneradt commented on issue #7922: Rotated squid.log files have hostname coming from request

Posted by GitBox <gi...@apache.org>.
bneradt commented on issue #7922:
URL: https://github.com/apache/trafficserver/issues/7922#issuecomment-861874455


   Hi @lukenowak,
   
   I created a PR to address the issue where `proxy.config.log.hostname` is not respected when rotating the logs. That is indeed a bug and should be fixed with PR #7943.
   
   In addition to `proxy.config.log.hostname` not being respected, you also mention that the default hostname used for the rotated logs changed from an IP address to the hostname of the machine between 8.x and 9.x. Is that an issue for you, or were you simply making an observation? That is, if #7943 is merged in and `proxy.config.log.hostname` is respected for the rotated logs, will that be a sufficient fix for you?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] lukenowak commented on issue #7922: Rotated squid.log files have hostname coming from request

Posted by GitBox <gi...@apache.org>.
lukenowak commented on issue #7922:
URL: https://github.com/apache/trafficserver/issues/7922#issuecomment-862217241


   > I mention this in case it's helpful to plan ahead for when you move to 9.1.x. In the meantime I'll look into the issues you reported here.
   
   That's excellent news, as soon as 9.1.x will be out I'll be happy to use it with logroration.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] lukenowak commented on issue #7922: Rotated squid.log files have hostname coming from request

Posted by GitBox <gi...@apache.org>.
lukenowak commented on issue #7922:
URL: https://github.com/apache/trafficserver/issues/7922#issuecomment-862216629


   If I'll be able to use `proxy.config.log.hostname` then the default hostname change is not a problem for me anymore, just having #7943 is good enough, thanks.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] bneradt closed issue #7922: Rotated squid.log files have hostname coming from request

Posted by GitBox <gi...@apache.org>.
bneradt closed issue #7922:
URL: https://github.com/apache/trafficserver/issues/7922


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org