[][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:

  1. Implement AccessLogger trait to define core logic of your extension
  2. 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 {
    const 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 Envoy Access Logger extension.

ConfigureOps

An interface for accessing extension config.

DrainOps

An interface for acknowledging Envoy that AccessLogger has been drained.

LogOps

An interface for accessing data of the HTTP stream or TCP connection that is being logged.