API Gateway container duplicated logs
search cancel

API Gateway container duplicated logs

book

Article ID: 417159

calendar_today

Updated On:

Products

CA API Gateway

Issue/Introduction

We have installed API Gateway 11.1.2 in container mode in a Kubernets/Tanzu environment.

We noticed that every logs produced by the gateway is duplicated. Here after a sample of the /var/log/pods/**************-gateway-xxxxxxxxxxxxxxx/gateway/0.log

2025-10-16T15:53:24.908512237Z stdout F {"package":"com.l7tech.log.custom.XXXX","level":"INFO","log":{"detail-id":-4.0,"message":{"streams":[{"stream":{"job":"L7-tanzu"},"values":[["65f51359-8c93-4c3b-9d76-008821b17cf8","apig-policy"]]}]},"service":"XXXXXXXX" [/api/*********/test*]","service-folder-path":"/XXXXX","listen-port":"Default HTTPS (*********)","client-ip":"xxxxxxxx","request-id":"0598f87566e94171-62ee8571c0656a62"},"time":"2025-10-16T15:53:24.908+0000","otelId":"aeee12ade10458e99acbab41477cb031-*****72e005f7b51a"}

2025-10-16T15:53:24.908648242Z stdout F {"package":"com.l7tech.log.custom.XXX","level":"INFO","log":{"detail-id":-4.0,"message":{"streams":[{"stream":{"job":"L7-tanzu"},"values":[["65f51359-8c93-4c3b-9d76-008821b17cf8","apig-policy"]]}]},"service":"XXXXXXX [/api/*********/test*]","service-folder-path":"/XXXXXXXX","listen-port":"Default HTTPS (******)","client-ip":"xxxxxxx","request-id":"0598f87566e94171-62ee8571c0656a62"},"time":"2025-10-16T15:53:24.908+0000","otelId":"aeee12ade10458e99acbab41477cb031-*****72e005f7b51a"}

Environment

11.1.2

Cause

This entries may seem duplicate , but their time stamps seem to be different so basically the logs are getting written twice because multiple source log sinks . 

And it’s caused by the config.log.properties section in the values.yaml.

Resolution

There are two JUL handlers enabled at the same time.

handlers = com.l7tech.server.log.GatewayRootLoggingHandler, com.l7tech.server.log.ConsoleMessageSink$L7ConsoleHandler
Both handlers write JSON logs to stdout, so each event gets printed twice — once by each handler.

Removing the entire line "handlers = com.l7tech.server.log.GatewayRootLoggingHandler, com.l7tech.server.log.ConsoleMessageSink$L7ConsoleHandler" fix the issue.