Skip to content

Allow setting a destination for log messages from wasm plugins #22669

Open

Description

@anuraaga

Title: Allow setting a destination for log messages from wasm plugins

Description:

Currently, logging from wasm plugins all go to envoy's app logs. However, there are use cases for separating out log files for specific domains - for example, a WAF filter will often need to have a separate audit log which is used for actioning on suspicious events.

One approach could be for the config to define log destinations

message LogDestination {
  oneof {
    string file_path = 1;
    
    string remote_log_service = 2;
  }
}

message VmConfig {
  ...
  map<string, LogDestination> log_destination

And the log ABI would be extended to accept a log destination string which would be mapped with that config.

[optional Relevant Links:]

#22557 (comment)

Activity

  1. added
    enhancement
    triage
    on Aug 12, 2022
  2. anuraaga commented on Aug 12, 2022

    @anuraaga
    ContributorAuthor

    @PiotrSikora Would be great to hear your thoughts on this.

    /cc @mathetake

  3. added and removed
    triage
    on Aug 12, 2022
  4. PiotrSikora commented on Aug 26, 2022

    @PiotrSikora
    Contributor

    This looks fine.

    One thing to keep in mind is that the current Proxy-Wasm ABI and various trivial integration (e.g. fwrite(stdout, ...) in C++ and logging macros in Rust) rely on having a default log destination, so it might be a good idea to add something like LogDestination default_log_destination (defaults to Envoy logs) to cover both: default output and a catch-all fallback for logging to an missing/unknown log_destination key.

    cc @mpwarres

  5. github-actions commented on Sep 25, 2022

    @github-actions

    This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

  6. added
    stale
    on Sep 25, 2022
  7. github-actions commented on Oct 2, 2022

    @github-actions

    This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions.

  8. PiotrSikora commented on Oct 7, 2022

    @PiotrSikora
    Contributor

    @kyessenov could you reopen this as well? Thanks!

  9. removed
    stale
    on Oct 7, 2022
  10. kyessenov commented on Dec 11, 2023

    @kyessenov
    Contributor

    xref #31148

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/wasmenhancementhelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions