# Custom log  categories in Plugins " is not a class name or namespace " UE\_LOG compile error

**URL:** <https://forums.unrealengine.com/t/custom-log-categories-in-plugins-is-not-a-class-name-or-namespace-ue_log-compile-error/105094>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [January 16, 2018, 11:57am UTC](https://forums.unrealengine.com/t/custom-log-categories-in-plugins-is-not-a-class-name-or-namespace-ue_log-compile-error/105094 "2018-01-16T11:57:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![darkgaze](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@darkgaze](https://forums.unrealengine.com/u/darkgaze)\
**Post date:** [January 16, 2018, 11:57am UTC](https://forums.unrealengine.com/t/custom-log-categories-in-plugins-is-not-a-class-name-or-namespace-ue_log-compile-error/105094/1 "2018-01-16T11:57:39Z")

</div>

I used to have code on my project.  
Now I moved all to a plugin inside the Plugins/ folder of the project with its subsecuent changes needed.

I Have a definition of a custom log category on the Module .h and .cpp of my plugin. Before moving files, this category was defined on the main projectName.h, as usual.

On the .h  
DECLARE\_LOG\_CATEGORY\_EXTERN(LOG\_NAME, Verbose, All);

On the .cpp  
DEFINE\_LOG\_CATEGORY(LOG\_NAME);

The rest of the files inside the sources folders (Private, Public) seem to not need the inclussion of “PluginNameModule.h” on every file… (seems like it).  
But all the UE\_LOGS are now failing. They all say that the LogCategory defined (LOG\_NAME) is not a class name or a namespace. And other errors follow.

What’s the best practice here when you are working on a plugin? I saw other plugins and none of them seem to include the module base .h to any file…

---

<div class="post-metadata">

**Author:** ![darkgaze](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@darkgaze](https://forums.unrealengine.com/u/darkgaze)\
**Post date:** [January 23, 2018, 3:02pm UTC](https://forums.unrealengine.com/t/custom-log-categories-in-plugins-is-not-a-class-name-or-namespace-ue_log-compile-error/105094/2 "2018-01-23T15:02:48Z")

</div>

I fixed this by including the base header file of the module, which contains the log declaration. But this seems weird, I thought this declaration was general for the whole project

---

<div class="post-metadata">

**Author:** ![nansP](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@nansP](https://forums.unrealengine.com/u/nansP)\
**Post date:** [September 3, 2020, 10:50am UTC](https://forums.unrealengine.com/t/custom-log-categories-in-plugins-is-not-a-class-name-or-namespace-ue_log-compile-error/105094/3 "2020-09-03T10:50:54Z")

</div>

Hi @darkgaze, did you find a better way to defined a log category in a plugin since ?

* * *

EDIT: Ok including the header file which declare the log category seems to be the standard way ([https://answers.unrealengine.com/questions/862022/issue-declaring-log-category.html](https://answers.unrealengine.com/questions/862022/issue-declaring-log-category.html)). Then I took my inspiration from Engine\Source\Runtime\AIModule\Private\AIModuleLog.h, just 1 dedicated file for my log categories I can include without extra code.
