Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
anuraaga opened this issue Aug 12, 2022 · 6 comments
Open

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

anuraaga opened this issue Aug 12, 2022 · 6 comments
Labels
area/wasm enhancement Feature requests. Not bugs or questions. help wanted Needs help!

Comments

@anuraaga
Copy link
Contributor

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)

@anuraaga anuraaga added enhancement Feature requests. Not bugs or questions. triage Issue requires triage labels Aug 12, 2022
@anuraaga
Copy link
Contributor Author

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

/cc @mathetake

@kyessenov kyessenov added area/wasm and removed triage Issue requires triage labels Aug 12, 2022
@PiotrSikora
Copy link
Contributor

PiotrSikora commented Aug 26, 2022

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

@github-actions
Copy link

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.

@github-actions github-actions bot added the stale stalebot believes this issue/PR has not been touched recently label Sep 25, 2022
@github-actions
Copy link

github-actions bot commented Oct 2, 2022

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.

@github-actions github-actions bot closed this as completed Oct 2, 2022
@PiotrSikora
Copy link
Contributor

@kyessenov could you reopen this as well? Thanks!

@kyessenov
Copy link
Contributor

kyessenov commented Dec 11, 2023

xref #31148

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/wasm enhancement Feature requests. Not bugs or questions. help wanted Needs help!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants