This is example observability backend support for Ferron, demonstrating how to integrate a custom observability backend with Ferron.
This observability backend support prints access logs to standard output, and error logs to standard error.
log_stdout [enable_log_stdout: bool]- This directive specifies whenever to log requests to standard output. Default:
log_stdout #false
- This directive specifies whenever to log requests to standard output. Default:
error_log_stderr [enable_log_stderr: bool]- This directive specifies whenever to log errors to standard error. Default:
error_log_stderr #false
- This directive specifies whenever to log errors to standard error. Default:
Configuration example:
dev.example.com {
// Enable example logging
log_stdout
error_log_stderr
// Custom test endpoints
status 200 url="/test" body="Test endpoint working"
status 500 url="/test-error" body="Simulated error"
}To compile Ferron with this observability backend support, first clone the Ferron repository:
git clone https://github.com/ferronweb/ferron.git -b develop-2.x
cd ferronThen, copy the ferron-build.yaml file to ferron-build-override.yaml:
cp ferron-build.yaml ferron-build-override.yamlAfter that, add the following line to the ferron-build-override.yaml file:
observability:
# Other observability backends...
- git: https://github.com/ferronweb/ferron-observability-example.git
crate: ferron-observability-example
loader: ExampleObservabilityBackendLoaderAfter modifying the ferron-build-override.yaml file, you can compile Ferron with this module by running the following command:
make buildOr if you're on Windows:
powershell -ExecutionPolicy Bypass .\build.ps1 BuildYou can then package it in a ZIP archive using the following command:
make packageOr if you're on Windows:
powershell -ExecutionPolicy Bypass .\build.ps1 PackageThe ZIP archive will be created in the dist directory, and can be installed using Ferron installer.