# log4j custom category name

**URL:** <https://community.wowza.com/t/log4j-custom-category-name/38411>\
**Category:** Wowza Streaming Engine\
**Created:** [March 17, 2015, 6:54pm UTC](https://community.wowza.com/t/log4j-custom-category-name/38411 "2015-03-17T18:54:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anton\_Garnik](https://avatars.discourse-cdn.com/v4/letter/a/fbc32d/32.png) [@Anton\_Garnik](https://community.wowza.com/u/Anton_Garnik)\
**Post date:** [March 17, 2015, 6:54pm UTC](https://community.wowza.com/t/log4j-custom-category-name/38411/1 "2015-03-17T18:54:31Z")

</div>

Hi,

There is a little but annoying problem with custom category names in log4j.

My goal is to filter logger output to show only output from my modules.

I have the following code:

```auto
WMSLoggerFactory.getLoggerObj(appInst).info("my comment blah blah", "ether", "comment", 200, appInst.getApplication().getName()+"/"+appInst.getName());

```

Then, in log4j.properties I write:

```auto
log4j.appender.ether.layout.CategoryInclude=ether

```

But log4j not allows this, sending following to stderr:

```auto
Log file configuration error: Invalid category name in CategoryInclude: ether

```

At the moment, I use this workaround:

```auto
log4j.appender.ether.layout.CategoryExclude=vhost,server,application,stream,session

```

But it not seems to be a good way.

Can somebody tell me where to dig?

---

<div class="post-metadata">

**Author:** ![Michelle\_B](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/michelle_b/32/394_2.png) [@Michelle\_B](https://community.wowza.com/u/Michelle_B)\
**Post date:** [March 18, 2015, 8:12am UTC](https://community.wowza.com/t/log4j-custom-category-name/38411/2 "2015-03-18T08:12:13Z")

</div>

Hi heronman,

Although you can add custom categories to the logs as needed, these categories are defined elsewhere. So when you invoke CategoryInclude, it checks against this pre-defined list.

[https://www.wowza.com/docs/how-to-configure-vhost-and-application-context-logging](https://www.wowza.com/docs/how-to-configure-vhost-and-application-context-logging)

Michelle
