Enable JSON Formatting and Customizable Schema for Lua Logs
- Dominant language
- Lua
- Stars
- 17.1k
- Forks
- 2.9k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 63
Description
### Description
### Summary
APISIX provides the ability to output logs from its internal Nginx component in JSON format with a customizable schema, which is incredibly useful for integration with log collection and analysis tools. However, logs generated by the Lua component do not currently support JSON formatting or schema customization.
This inconsistency complicates centralized log collection and parsing, as it requires maintaining separate parsers for Lua logs, adding complexity and operational overhead.
### Proposal
- Extend support for JSON-formatted logs to the Lua component.
- Allow customization of the JSON schema for Lua logs, similar to the functionality provided by the Nginx component.
### Benefits
**Unified Logging**: Consistent JSON formatting across all components (Nginx and Lua) would simplify log collection and analysis with systems like Elasticsearch, Loki, or Fluentd.
Contributor guide
Research direction
Start by locating the existing JSON formatting and customizable schema implementation for APISIX's Nginx logs, then trace how Lua component logs are generated. Compare the two logging paths and determine the expected unified schema and configuration behavior. Done means Lua logs support JSON output and schema customization consistently with the Nginx component, with coverage for the new behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua, nginx
- Domain
- observability-sre
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100