# Not able to use console.log() in plugin components in kibana 7.8 OSS version

**URL:** <https://discuss.elastic.co/t/not-able-to-use-console-log-in-plugin-components-in-kibana-7-8-oss-version/247331>\
**Category:** Kibana\
**Created:** [September 3, 2020, 6:20am UTC](https://discuss.elastic.co/t/not-able-to-use-console-log-in-plugin-components-in-kibana-7-8-oss-version/247331 "2020-09-03T06:20:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jayanth\_Mogadampalli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jayanth_mogadampalli/32/74602_2.png) [@Jayanth\_Mogadampalli](https://discuss.elastic.co/u/Jayanth_Mogadampalli)\
**Post date:** [September 3, 2020, 6:20am UTC](https://discuss.elastic.co/t/not-able-to-use-console-log-in-plugin-components-in-kibana-7-8-oss-version/247331/1 "2020-09-03T06:20:50Z")

</div>

I am developing a plugin for authentication in Kibana 7.8 oss version  
In that plugin, showing error while using console.log() statement  
For resolving the error, I tried to declare console variable first and gave it Console type and then used console.log(). But didn't work

Here's the code:

> ```
> let console: Console;
> console.log('Attempt to login with google');
> 
> ```

Here's the error:  
`Uncaught TypeError: Cannot read property 'log' of undefined`

**How to use console.log() and debugger in plugin components  
Is there any dev mode?**

---

<div class="post-metadata">

**Author:** ![lukeelmers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukeelmers/32/35230_2.png) [@lukeelmers](https://discuss.elastic.co/u/lukeelmers)\
**Post date:** [September 3, 2020, 9:04pm UTC](https://discuss.elastic.co/t/not-able-to-use-console-log-in-plugin-components-in-kibana-7-8-oss-version/247331/2 "2020-09-03T21:04:23Z")

</div>

Are you certain the code is running on the browser and not the server?

`console.log` should work in the browser, however you'll get an eslint warning. To make sure the code is running in the browser, double check that it lives in a `myPlugin/public` directory.

You can't use `console.log` on the server; instead you should use core's [logging service](https://github.com/elastic/kibana/blob/master/docs/development/core/server/kibana-plugin-core-server.logger.md). You can learn more about it in the [README](https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.md).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 1, 2020, 9:04pm UTC](https://discuss.elastic.co/t/not-able-to-use-console-log-in-plugin-components-in-kibana-7-8-oss-version/247331/3 "2020-10-01T21:04:34Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
