[−][src]Module envoy_sdk::extension::access_logger
Envoy
Access Logger
extension.
Creating a new Access Logger
extension using Envoy SDK
consists of the following steps:
- Implement
AccessLogger
trait to define core logic of your extension Register
your extension on WebAssembly module start up
Examples
Basic AccessLogger
:
use envoy::extension::AccessLogger; /// My very own `AccessLogger`. struct MyAccessLogger; impl AccessLogger for MyAccessLogger { fn name() -> &'static str { "my_access_logger" } }
Registration of MyAccessLogger
on start up:
use envoy::extension::{entrypoint, Module, Result}; entrypoint! { initialize } // put initialization logic into a function to make it unit testable fn initialize() -> Result<Module> { Module::new() .add_access_logger(|_instance_id| Ok(MyAccessLogger)) }
Traits
AccessLogger | An interface of the |
ConfigureOps | An interface for operations available in the context of |
DrainOps | An interface for acknowledging |
LogOps | An interface for accessing data of the HTTP stream or TCP connection that is being logged. |