Console log outputs being suppressed in datasource plugin

I am creating a datasource plugin for Grafana (8.x) and I am unable to get anything to print to the console window using console.log(). There are other parts of Grafana that are logging fine but for some reason they won’t log out of my plugin. Here is my config.monitoring file:

GF_SECURITY_ADMIN_PASSWORD=foobar
GF_USERS_ALLOW_SIGN_UP=false
GF_SECURITY_ALLOW_EMBEDDING=true
GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=j-siegel-datasource,marcusolsson-json-datasource
GF_PLUGIN_GRAFANA-IMAGE_RENDERER_RENDERING_IGNORE_HTTPS_ERRORS=true
GF_LOG_MODE=console

None of this jumps out to me as something that would suppress logging. Is there something in the plugin itself that could disable logging?

EDIT: I just realized that I can log out of datasource.ts, but not in QueryEditor.tsx. Is there an issue with logging in a .tsx file? I don’t recall having issues with it in the past.

I’m not aware of a configuration that would disable browser logging. Since you’re able to output logs in datasource.ts. Forgive the basic question, but are you certain that the log statement is in the execution path?

Yeah you got me, it wasn’t in the execution path when I asked this question. Thanks Marcus!

1 Like