Thank you very much Brian for the deep analysis and the bug confirmation.

I would like to stay with the Debian distribution package for ATS, so I will 
see if there is a backport available.

For the moment, I scheduled a restart just after the log rotation, as a 
workaround.

Best regards.
Lorenzo


Da: Brian Neradt <[email protected]>
Inviato: sabato 19 giugno 2021 22:57
A: [email protected]
Oggetto: Re: Problem with logging with ver. 8.0.2

Hi Lorenzo,

I have reproduced the issue you are seeing with 8.0.2. After the logs were 
rotated, logging continued to be emitted to the rotated log rather than the new 
one. This is clearly a bug. I then updated Traffic Server to 8.1.1 and observed 
that this issue is resolved in that release: new log entries are emitted to the 
new blog file. While I was at it, I also verified that 
proxy.config.log.rolling_allow_empty (new in the 8.1.x releases) does indeed 
rotate the log even if empty.

Is it possible for you to update to at least 8.1.x? It looks like it will 
behave as you desire it to.

Thanks,
Brian

On Fri, Jun 18, 2021 at 6:02 PM Brian Neradt 
<[email protected]<mailto:[email protected]>> wrote:
Just a quick follow up: I could not reproduce this locally on the 9.0.x systems 
I have convenient access to. I'll try further on 8.0.x.

Looking through commits, I notice significant changes were made around log 
rolling - and, significantly, reopening log files after rolling - in this PR:
https://github.com/apache/trafficserver/pull/6553

It is possible that PR fixed this issue you're seeing. As an aside, it in fact 
adds the configuration options you mentioned in your previous email. That PR 
made it into 8.1.x, not 8.0.2, so you wouldn't have it with the version you're 
testing.

Thanks,


On Fri, Jun 18, 2021 at 12:21 PM Brian Neradt 
<[email protected]<mailto:[email protected]>> wrote:
Thank you Lorenzo for the details. I'll investigate this today and get back to 
you.

On Fri, Jun 18, 2021 at 1:35 AM MAURIZI Lorenzo 
<[email protected]<mailto:[email protected]>> wrote:
Unfortunately, log rolling does not work, even after the changes: the new logs 
are written onto the rotated log file.

Here is the directory listing at 18/06/2021 8:29

root@it-net-proxy2:/var/log/trafficserver# ll
total 132
drwxr-x--- 2 trafficserver adm            4096 Jun 16 07:00 .
drwxr-xr-x 9 root          root           4096 Jun 18 00:00 ..
-rw-r--r-- 1 trafficserver trafficserver    27 May 27 15:09 .diags.log.meta
-rw-r--r-- 1 trafficserver trafficserver    27 May 27 15:09 .manager.log.meta
-rw-r--r-- 1 trafficserver trafficserver    67 Jun 15 08:41 .squid.blog.meta
-rw-r--r-- 1 trafficserver trafficserver 11870 Jun 15 09:47 diags.log
-rw-r--r-- 1 trafficserver trafficserver 72990 Jun 15 09:47 manager.log
-rw-r--r-- 1 trafficserver trafficserver  2472 May 28 11:47 
squid.blog_it-net-proxy2.20210527.15h13m48s-20210528.00h00m02s.old
-rw-r--r-- 1 trafficserver trafficserver  3408 Jun  3 12:05 
squid.blog_it-net-proxy2.20210528.11h51m31s-20210601.07h00m01s.old
-rw-r--r-- 1 trafficserver trafficserver  3160 Jun  8 17:37 
squid.blog_it-net-proxy2.20210603.16h51m09s-20210607.07h00m01s.old
-rw-r--r-- 1 trafficserver trafficserver  2008 Jun 15 08:39 
squid.blog_it-net-proxy2.20210609.10h14m08s-20210610.07h00m00s.old
-rw-r--r-- 1 trafficserver trafficserver  5440 Jun 18 08:26 
squid.blog_it-net-proxy2.20210615.08h41m21s-20210616.07h00m04s.old

As you can see, the last file (rotated the 16th of june) has been modified 
today, some minutes ago. No squid.blog file is present.
If I list the content of the rotated file with traffic_logcat, I can see the 
recent traffic.

Is it a known bug?

Apart from restarting the daemon, is there any other workaround? (e.g. tweaking 
a configuration directive)
Thanks in advance.

Lorenzo



Da: MAURIZI Lorenzo
Inviato: martedì 15 giugno 2021 09:52
A: '[email protected]<mailto:[email protected]>' 
<[email protected]<mailto:[email protected]>>
Oggetto: R: Problem with logging with ver. 8.0.2

Dear all
I found out that some of the configuration directives I used are not supported 
by Trafficserver 8.0.x
In particular
proxy.config.log.rolling_allow_empty
and
proxy.config.log.rolling_max_count

I removed those configuration directives and will see what happens.

Best regards
Lorenzo

Da: MAURIZI Lorenzo
Inviato: giovedì 3 giugno 2021 17:29
A: '[email protected]<mailto:[email protected]>' 
<[email protected]<mailto:[email protected]>>
Oggetto: Problem with logging with ver. 8.0.2

Hi all,
I have just installed Traffic Server 8.0.2 (the version from Debian 10 
repositories) and I noticed some problems with logging.

In particular, I would like to rotate the binary log every day at 7.00 AM and 
rotate even if the file is empty (at 6.55 the daily cron script analyzes the 
squid.blog file with calamaris script, so I lose 5 minutes of potential 
traffic, but it’s ok).
The rotation does not work as expected, and as a worst behaviour, after 
rotation the daemon keeps logging into the rotated file.

Please look at this ls listing:
root@it-net-proxy2:/etc/trafficserver# ll /var/log/trafficserver/
total 92
drwxr-x--- 2 trafficserver adm            4096 Jun  1 07:00 .
drwxr-xr-x 9 root          root           4096 Jun  3 00:00 ..
-rw-r--r-- 1 trafficserver trafficserver    27 May 27 15:09 .diags.log.meta
-rw-r--r-- 1 trafficserver trafficserver    27 May 27 15:09 .manager.log.meta
-rw-r--r-- 1 trafficserver trafficserver    67 May 28 11:51 .squid.blog.meta
-rw-r--r-- 1 trafficserver trafficserver  8190 Jun  3 16:51 diags.log
-rw-r--r-- 1 trafficserver trafficserver 51039 Jun  3 16:51 manager.log
-rw-r--r-- 1 trafficserver trafficserver  2472 May 28 11:47 
squid.blog_it-net-proxy2.20210527.15h13m48s-20210528.00h00m02s.old
-rw-r--r-- 1 trafficserver trafficserver  3408 Jun  3 12:05 
squid.blog_it-net-proxy2.20210528.11h51m31s-20210601.07h00m01s.old
root@it-net-proxy2:/etc/trafficserver#

As you can see, there is no squid.blog file and the rotated log 
squid.blog_it-net-proxy2.20210528.11h51m31s-20210601.07h00m01s.old has been 
modified the 3rd of June, even if its title states that it contains logs till 
the 1st of june at 7 AM.
If I restart the daemon, it starts logging into the plain squid.blog again.
The log files are quite empty, as the server is in pre-production phase (only 
one client uses this proxy, with very low traffic).

Here is the relevant part of the records.config file, related to logging:

CONFIG proxy.config.log.logging_enabled INT 3
CONFIG proxy.config.log.max_space_mb_for_logs INT 10000
CONFIG proxy.config.log.max_space_mb_headroom INT 500
CONFIG proxy.config.log.rolling_enabled INT 1
CONFIG proxy.config.log.rolling_offset_hr INT 7
CONFIG proxy.config.log.rolling_interval_sec INT 86400
CONFIG proxy.config.log.rolling_allow_empty INT 1
CONFIG proxy.config.log.auto_delete_rolled_files INT 1
CONFIG proxy.config.log.periodic_tasks_interval INT 5
CONFIG proxy.config.log.rolling_max_count INT 365

What I would like to obtain is a daily rotated log file, and keep a year of 
rotated logfiles.
Is there anything wrong?
Why Traffic Server keeps logging into rotated file?

Thank you in advance for any help.

_______________________________________
Lorenzo Maurizi
Servizio Sviluppo Tecnologico
Comune di Jesi



--
"Come to Me, all who are weary and heavy-laden, and I will
give you rest. Take My yoke upon you and learn from Me, for
I am gentle and humble in heart, and you will find rest for
your souls. For My yoke is easy and My burden is light."

    ~ Matthew 11:28-30


--
"Come to Me, all who are weary and heavy-laden, and I will
give you rest. Take My yoke upon you and learn from Me, for
I am gentle and humble in heart, and you will find rest for
your souls. For My yoke is easy and My burden is light."

    ~ Matthew 11:28-30


--
"Come to Me, all who are weary and heavy-laden, and I will
give you rest. Take My yoke upon you and learn from Me, for
I am gentle and humble in heart, and you will find rest for
your souls. For My yoke is easy and My burden is light."

    ~ Matthew 11:28-30

Reply via email to