# UE\_LOG defined in module not recognized in other files

**URL:** <https://forums.unrealengine.com/t/ue_log-defined-in-module-not-recognized-in-other-files/415902>\
**Category:** Community & Industry Discussion\
**Tags:** logging, include, category, unreal-engine, log, question\
**Created:** [January 30, 2018, 11:25am UTC](https://forums.unrealengine.com/t/ue_log-defined-in-module-not-recognized-in-other-files/415902 "2018-01-30T11:25:25Z")\
**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 30, 2018, 11:25am UTC](https://forums.unrealengine.com/t/ue_log-defined-in-module-not-recognized-in-other-files/415902/1 "2018-01-30T11:25:25Z")

</div>

I declare in my module. h and .cpp a new log category. I use extern to let the compiler know it’s a global new log category.

In my .h that extends IModuleInterface  
**DECLARE\_LOG\_CATEGORY\_EXTERN(name…, … , … )**

In my .cpp  
**DEFINE\_LOG\_CATEGORY(name…);**

But I get this error in every single file I use UE\_LOG(name… , etc)

**‘FLogCategoryname…’: is not a class name or a namespace**

I fixed this by including the module .h into all cpp files where I use the UE\_LOG. But some of them still don’t work and it’s included.

**I find this really suspicious and it doesn’t look right to include the module main file like this**. Any ideas?

---

<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:** [February 5, 2018, 5:21pm UTC](https://forums.unrealengine.com/t/ue_log-defined-in-module-not-recognized-in-other-files/415902/2 "2018-02-05T17:21:11Z")

</div>

Said in the docs : If you create a category, you have to include the header file into every file that uses it (generally in cpp files instead of header files. You don’t usually see UE\_LOGs in headers).

If it doesn’t work, then the problem could be that you are not using the proper name, the exact name of the category you created. This was my case, I forgot a letter in caps somewhere.

---

<div class="post-metadata">

**Author:** ![FelipeArruda](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FelipeArruda](https://forums.unrealengine.com/u/FelipeArruda)\
**Post date:** [November 18, 2021, 6:04pm UTC](https://forums.unrealengine.com/t/ue_log-defined-in-module-not-recognized-in-other-files/415902/3 "2021-11-18T18:04:55Z")

</div>

Thanks, I had the exact same problem (forgot a letter in caps in the middle of the log name). Took me a really long time to find that one out!
