Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding tcp logger. #1221

Merged
merged 1 commit into from
Mar 15, 2020
Merged

Adding tcp logger. #1221

merged 1 commit into from
Mar 15, 2020

Conversation

Akayeshmantha
Copy link
Member

@Akayeshmantha Akayeshmantha commented Mar 7, 2020

Summary

Adding support to tcp logger plugin.

Full changelog

Started working on tcp logger plugin

Referring these 2 repos :- https://github.com/openresty/lua-nginx-module#udpsocksetpeername
https://github.com/fluent/fluent-logger-node

I am more familiar with node.js so I thought it would help me. to understand the flow

Issues resolved

Fix #1220

@juzhiyuan juzhiyuan changed the title adding tcp logger.[Work not finished yet] adding tcp logger.[WIP] Mar 10, 2020
@juzhiyuan juzhiyuan changed the title adding tcp logger.[WIP] WIP: adding tcp logger. Mar 10, 2020
@Akayeshmantha Akayeshmantha force-pushed the patch5 branch 3 times, most recently from 5da6b3e to c37c911 Compare March 10, 2020 21:35
@Akayeshmantha Akayeshmantha changed the title WIP: adding tcp logger. Adding tcp logger. Mar 11, 2020
@Akayeshmantha
Copy link
Member Author

Hi @membphis @moonming

I completed the tcp logger but am getting below error in a unit test (test 5 access).

Failed test 'TEST 5: access - pattern "[error]" should not match any line in error.log but matches line "2020/03/11 09:41:17 [error] 26326\#26326: *21 [lua] tcp-logger.lua:61: failed to connect to TCP server: host[127.0.0.1] port[2001] connection refused, context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:1984" (req 0)

Any thoughts am actually blocked here

@moonming
Copy link
Member

@Akayeshmantha the test case 5 will connect tcp log server 127.0.0.1:5044, which not exist, so it will fail.
you can mock tcp log server like this: https://github.com/apache/incubator-apisix/blob/master/t/APISIX.pm#L107

@Akayeshmantha
Copy link
Member Author

Akayeshmantha commented Mar 12, 2020

Finally thanks @moonming @membphis . It's ready to review

@moonming
Copy link
Member

need add plugin doc and README.md.

@Akayeshmantha
Copy link
Member Author

@moonming added thanks.

@Akayeshmantha
Copy link
Member Author

@moonming added the readme file and the document.

@Akayeshmantha
Copy link
Member Author

@membphis @moonming can we merge this PR. If the read me doc is ok I can add udp plugin readme as well.

@membphis membphis merged commit d078711 into apache:master Mar 15, 2020
@membphis
Copy link
Member

merged, many thx

SaberMaster pushed a commit to SaberMaster/incubator-apisix that referenced this pull request Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add TCP logger plugin.
3 participants