# Logging/Debugging Service

**URL:** <https://forums.plex.tv/t/logging-debugging-service/95044>\
**Category:** Dev/API Corner\
**Tags:** plugin-dev\
**Created:** [February 26, 2015, 3:08pm UTC](https://forums.plex.tv/t/logging-debugging-service/95044 "2015-02-26T15:08:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nights0ng](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/nights0ng/32/11035_2.png) [@Nights0ng](https://forums.plex.tv/u/Nights0ng)\
**Post date:** [February 26, 2015, 3:08pm UTC](https://forums.plex.tv/t/logging-debugging-service/95044/1 "2015-02-26T15:08:59Z")

</div>

In creating my plugin, I created a service and I'm trying to figure out how I can add some logging to it.

&nbsp;

If I use the **Log(message)** in the service like I use in the \_\_init\_\_.py file, it (seemly) throws an exception and exits early. I'm guessing there is a different way that I need to do this, or maybe there is a way to actually run it through in a debug mode?

---

<div class="post-metadata">

**Author:** ![manfer](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/manfer/32/10663_2.png) [@manfer](https://forums.plex.tv/u/manfer)\
**Post date:** [February 26, 2015, 3:13pm UTC](https://forums.plex.tv/t/logging-debugging-service/95044/2 "2015-02-26T15:13:38Z")

</div>

[https://dev.plexapp.com/docs/api/logkit.html#module-Log](https://dev.plexapp.com/docs/api/logkit.html#module-Log)  
  
  
though I suppose you mean you already do that. Log.Info(message), or similar, not just Log(message). Well, in fact, maybe even Log(message) is correct. I didn’t new using one of the methods is not mandatory. Anyway you could try with one of the methods, Info, Debug, …  
  
  
Maybe it is useful too to show here what the exception looks like.  
  
  
The URLService for Youtube included with Plex uses Log without any problem and without importing anything to use that function. The file is located in Windows inside your plex installation in folder \Resources\Plug-ins\Services.bundle\Contents\Service Sets\com.plexapp.plugins.youtube\URL\YouTube\ServiceCode.pys

---

<div class="post-metadata">

**Author:** ![Nights0ng](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/nights0ng/32/11035_2.png) [@Nights0ng](https://forums.plex.tv/u/Nights0ng)\
**Post date:** [February 26, 2015, 3:52pm UTC](https://forums.plex.tv/t/logging-debugging-service/95044/3 "2015-02-26T15:52:40Z")

</div>

Thanks for the link to the docs, meant to look a bit closer at the Log module. Using just Log(message) seems to work fine in the \_\_init\_\_ works fine, I was wanting to see if you could change the log level as well.

I'll try it again tonight, maybe something else I was doing wrong was incorrect. Otherwise, maybe it gets put into a different log file than what is defined in **Info.plist**?

---

<div class="post-metadata">

**Author:** ![Nights0ng](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/nights0ng/32/11035_2.png) [@Nights0ng](https://forums.plex.tv/u/Nights0ng)\
**Post date:** [February 26, 2015, 4:51pm UTC](https://forums.plex.tv/t/logging-debugging-service/95044/4 "2015-02-26T16:51:43Z")

</div>

Ok, I see why I wasn't finding it. The service logs to the com.plexapp.system.log and not the one for the plugin. Makes sense in the end I suppose.

---

<div class="post-metadata">

**Author:** ![manfer](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/manfer/32/10663_2.png) [@manfer](https://forums.plex.tv/u/manfer)\
**Post date:** [February 26, 2015, 5:03pm UTC](https://forums.plex.tv/t/logging-debugging-service/95044/5 "2015-02-26T17:03:51Z")

</div>

> Ok, I see why I wasn't finding it. The service logs to the com.plexapp.system.log and not the one for the plugin. Makes sense in the end I suppose.

  
I would had expected the message logged to the plugin log too

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [January 8, 2020, 7:47pm UTC](https://forums.plex.tv/t/logging-debugging-service/95044/6 "2020-01-08T19:47:28Z")

</div>


