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

help request: How to customize the log file path in apisix-go-plugin-runner #118

Open
ZChengjin opened this issue Nov 23, 2022 · 7 comments
Labels
documentation Improvements or additions to documentation

Comments

@ZChengjin
Copy link

ZChengjin commented Nov 23, 2022

Description

As the documentation says I modified the LogOutput of runner.RunnerConfig{} by modifying LogFilePath, but no matter what path I modify LogFilePath to, the log of go-plugin will be printed in apisix_log/error.log in the end.So I want to know How can I customize the log file path in apisix-go-plugin-runner.Thanks

Environment

APISIX version (run apisix version):3.0.0
Operating system (run uname -a):Linux eee3e01b5631 4.19.76-linuxkit apache/apisix#1 SMP Tue May 26 11:42:35 UTC 2020 x86_64 GNU/Linux
OpenResty / Nginx version (run openresty -V or nginx -V):nginx version: openresty/1.21.4.1;built by gcc 10.2.1 20210110 (Debian 10.2.1-6);built with OpenSSL 1.1.1n 15 Mar 2022
etcd version, if relevant (run curl http://127.0.0.1:9090/v1/server_info):
APISIX Dashboard version, if relevant:apache/apisix-dashboard:2.13-alpine
Plugin runner version, for issues related to plugin runners:apisix-go-plugin-runner(master)
LuaRocks version, for installation issues (run luarocks --version):

@Hazel6869
Copy link

Hazel6869 commented Nov 23, 2022

@ZChengjin Hi, can you give me your code? I will check for you.

@Hazel6869
Copy link

@ZChengjin are you reload the code?

@ZChengjin
Copy link
Author

of course

@ZChengjin
Copy link
Author

ZChengjin commented Nov 24, 2022

@ZChengjin Hi, can you give me your code? I will check for you.

const (
	Dev  RunMode = iota // Development
	Prod                // Product
	Prof                // Profile

	ProfileFilePath = "./logs/profile."
	LogFilePath     = "../apisix_log/test.log"  //i just modified this
)

I just modified the LogFilePath in apisix-go-plugin-runner/cmd/go-runner/main.go

@tzssangglass tzssangglass transferred this issue from apache/apisix Nov 25, 2022
@soulbird
Copy link
Contributor

soulbird commented Dec 9, 2022

Are you sure this path exists? Are there any failed to open log... related logs in the apisix log? Can you see the go-runner log if you don't make any changes?

@jobop
Copy link

jobop commented Dec 10, 2022

i have the same problem

@soulbird
Copy link
Contributor

go-runner is started in dev mode by default, and the log will be output in stdout. When go-runner is hosted in apisix, the log will be output in error.log.
You can use go-runner run -m prod to change the run mode of go-runner so that you can see individual log files. In apisix, you can use the following configuration:

ext-plugin:
   cmd: ["/path-to-your/go-runner/apisix-go-runner", "run", "-m", "prod"]

We will supplement the documentation on this.

@soulbird soulbird added the documentation Improvements or additions to documentation label Dec 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants