Expand description
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§
- Access
Logger - An interface of the
Envoy
Access Logger
extension. - Configure
Ops - An interface for operations available in the context of
on_configure
invocation. - Drain
Ops - An interface for acknowledging
Envoy
thatAccessLogger
has been drained. - LogOps
- An interface for accessing data of the HTTP stream or TCP connection that is being logged.