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

Expose event.context.azure for logging #383

Open
tobiasdiez opened this issue Aug 3, 2022 · 0 comments
Open

Expose event.context.azure for logging #383

tobiasdiez opened this issue Aug 3, 2022 · 0 comments

Comments

@tobiasdiez
Copy link
Contributor

tobiasdiez commented Aug 3, 2022

Environment

  • Operating System: Linux
  • Node Version: v16.16.0
  • Nuxt Version: 3.0.0-rc.5
  • Package Manager: yarn@1.22.19
  • Builder: vite
  • User Config: alias, nitro, ssr, meta, css, tailwindcss, modules, watch, runtimeConfig, serverHandlers, storybook, hooks, vite
  • Runtime Modules: @nuxtjs/tailwindcss@5.1.3, @pinia/nuxt@0.3.1, ./modules/storybook, -runtime-compiler-module
  • Build Modules: -

Reproduction

Just have a function with console.log("something").

Describe the bug

Azure requires that logs are attached to a function run via context.log (instead of say console.log), see https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-node?tabs=v2-v3-v4-export%2Cv2-v3-v4-done%2Cv2%2Cv2-log-custom-telemetry%2Cv2-accessing-request-and-response%2Cwindows-setting-the-node-version#write-trace-output-to-logs.
But as far as I can see there is no wrapper to provide framework independent logging nor a way to get the azure context from within nitro/nuxt.

Additional context

Maybe one could use the async hooks to introduce a useLogger method (similar to useEvent of #1546). This would allow to bound the logging output to the correct function invocation (see BrianRosamilia/azure-function-log-intercept#4 for background).

Logs

No response

@Hebilicious Hebilicious added enhancement New feature or request and removed feature request labels Jul 17, 2023
@pi0 pi0 changed the title Azure: Support logging Expose event.context.azure May 16, 2024
@pi0 pi0 changed the title Expose event.context.azure Expose event.context.azure for logging May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants