Commit Graph

4 Commits

Author SHA1 Message Date
a92a67eaa2 chore: set content-type in the module
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Has been cancelled
2025-11-15 19:08:44 -08:00
56c6045e3b Use ngx_log_error! macro and fix formatting
- Switched from ngx_log_error_core() to ngx_log_error! macro
- Changed error_log level from debug to info (cleaner output)
- Formatting cleanup across all modules (cargo fmt)
- Removed trailing newlines and fixed indentation

Logging now properly uses nginx's macro system for better
integration with nginx's log handling.
2025-11-15 17:16:55 -08:00
86b79c0a85 Implement structured logging with ngx_log_error_core
Logging now uses nginx's native error log with proper levels:
- ERROR (level 3): Configuration/query/template failures
- WARN (level 4): Missing parameters
- INFO (level 6): Request processing, template resolution
- DEBUG (level 7): Detailed tracing

Log Format: [sqlite-serve:module] message

Example output:
- [info] [sqlite-serve:handler] Processing request for /books
- [info] [sqlite-serve:template] Resolved template: ./server_root/books/catalog.hbs
- [info] [sqlite-serve:params] Resolved 1 parameters
- [notice] [sqlite-serve:success] Rendered catalog.hbs with 1 params

Specialized logging functions:
- log_config_error(): Invalid configuration
- log_query_error(): SQL errors with query shown
- log_template_error(): Template failures with path
- log_param_error(): Parameter resolution issues
- log_request_success(): Successful processing info
- log_template_loading(): Template discovery

Uses ngx_log_error_core() C API directly for dynamic messages.

Test Coverage: 59 tests
Configuration: error_log set to debug level for visibility
2025-11-15 17:05:09 -08:00
a4a838ad3b Consolidate examples into unified production config with static CSS
- New sqlite_serve.conf: all features on single port 8080
- New zenburn.css: hex color palette, all styles in one cacheable file
- New Zenburn templates: header/footer/card partials
- New start.sh: unified launcher with all endpoint docs
- Removed 3 separate example configs and start scripts

15 files changed, 980 insertions(+), 258 deletions(-)
2025-11-15 16:42:05 -08:00