feat(file-logger): use io.stdout/io.stderr for /dev/stdout and /dev/stderr paths#13681
Open
ecsimsw wants to merge 8 commits into
Open
feat(file-logger): use io.stdout/io.stderr for /dev/stdout and /dev/stderr paths#13681ecsimsw wants to merge 8 commits into
ecsimsw wants to merge 8 commits into
Conversation
ecsimsw
marked this pull request as draft
July 16, 2026 12:51
…cache std_files is already resolved before open_file_cache is called, so the branch inside open_file_cache was dead code.
`apisix start` launches nginx via io.popen and consumes its stdout, so it cannot observe /dev/stdout output. Run openresty in the foreground like the container entrypoint does, and wait for readiness instead of a fixed sleep.
ecsimsw
marked this pull request as ready for review
July 16, 2026 14:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
file-loggerplugin usesio.open(path, "a+"), even when path is/dev/stdoutor/dev/stderrPermission deniedin restricted environmentsio.stdoutorio.stderrLua runtime handles, which are always available regardless of file permissions"path": "/dev/stdout"configuration works as beforeChanges
apisix/plugins/file-logger.lua: useio.stdout/io.stderrhandles instead ofio.openwhen path is/dev/stdoutor/dev/stderrt/cli/test_file_logger_stdout.sh: add CLI test for stdout outputdocs/en/latest/plugins/file-logger.md: document/dev/stdoutand/dev/stderrin path attributedocs/zh/latest/plugins/file-logger.md: same for Chinese docsNote on test approach
openrestydirectly in the foreground instead of usingapisix start.apisix startlaunches nginx viaio.popen(cmd):read("*all")which consumes the process stdout, making/dev/stdoutoutput unobservable from outside.docker-entrypoint.sh).Which issue(s) this PR fixes:
Fixes #6797
Checklist