Closed dave-powell-kensho closed 9 months ago
@dave-powell-kensho I see that log rotate support was added in https://github.com/aws/aws-network-policy-agent/pull/87, which does appear to be present in v1.5.0
.
From looking at https://github.com/aws/aws-network-policy-agent/blob/main/pkg/logger/logger.go#L84, I am wondering if the problem is you using the string /dev/stdout
instead of just stdout
as the code seems to check for. Can you try stdout
?
@dave-powell-kensho I see that log rotate support was added in #87, which does appear to be present in
v1.5.0
.From looking at https://github.com/aws/aws-network-policy-agent/blob/main/pkg/logger/logger.go#L84, I am wondering if the problem is you using the string
/dev/stdout
instead of juststdout
as the code seems to check for. Can you trystdout
?
Changing to just stdout
did fix the issue. Thanks for looking into this!
What happened:
Set logging to stdout by passing arg
--log-file=/dev/stdout
. After some hours/quantity of logs it appears that a log rotation occurs, moving the symlink/dev/stdout
and beginning a new file in its place.Attach logs
What you expected to happen: No log rotation when logging to
/dev/stdout
(or/dev/stderr
)How to reproduce it (as minimally and precisely as possible): Set arg
--log-file=/dev/stdout
and generate enough output/wait long enough for a log rotation to take place.Anything else we need to know?: This is from the ECR image distribution,
602401143452.dkr.ecr.us-east-1.amazonaws.com/amazon/aws-network-policy-agent:v1.0.5
Environment:
kubectl version
): v1.26.11cat /etc/os-release
): Amazon Linux 2uname -a
): 5.10.192-183.736.amzn2.x86_64