spacewander commented on a change in pull request #5768:
URL: https://github.com/apache/apisix/pull/5768#discussion_r767265715



##########
File path: t/cli/test_access_log.sh
##########
@@ -224,3 +224,41 @@ fi
 
 make stop
 echo "passed: should find upstream scheme"
+
+# check stream logs
+echo '
+apisix:
+    stream_proxy:                  # UDP proxy
+     udp:
+       - "127.0.0.1:9200"
+
+nginx_config:
+  stream:
+    enable_access_log: true
+    access_log_format: "$remote_addr $protocol test_stream_access_log_format"
+' > conf/config.yaml
+
+make init
+
+grep "test_stream_access_log_format" conf/nginx.conf > /dev/null
+if [ ! $? -eq 0 ]; then
+    echo "failed: stream access_log_format in nginx.conf doesn't change"
+    exit 1
+fi
+
+# check if logs are being written
+make run
+sleep 0.1
+# sending single udp packet
+echo -n "hello" | nc -4u -w0 localhost 9200
+sleep 4
+tail -n 1 logs/access_stream.log > output.log
+
+if ! grep '127.0.0.1 UDP test_stream_access_log_format' output.log; then
+    echo "failed: should have found udp log entry"
+    cat output.log
+    exit 1
+fi
+
+make stop

Review comment:
       We will clean up automatically, so there is no need to add it. See 
https://github.com/apache/apisix/blob/02d32c9dbc0813e68f51075b2ff8a067f60fca6a/t/cli/common.sh#L32




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

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


Reply via email to