# Custom Log Level Log4J

**URL:** <https://discuss.elastic.co/t/custom-log-level-log4j/55733>\
**Category:** Logstash\
**Created:** [July 18, 2016, 7:42am UTC](https://discuss.elastic.co/t/custom-log-level-log4j/55733 "2016-07-18T07:42:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pat123](https://avatars.discourse-cdn.com/v4/letter/p/8c91f0/32.png) [@pat123](https://discuss.elastic.co/u/pat123)\
**Post date:** [July 18, 2016, 7:42am UTC](https://discuss.elastic.co/t/custom-log-level-log4j/55733/1 "2016-07-18T07:42:16Z")

</div>

Hello,  
I would like to have a custom log level for some tests in my code. I using log4j in a java-project.  
The needed level is created and works in my local console output, but I can not show the log in Kibana. I think it is a Problem with the Logstash config file but don’t know what I have to add for custom log levels.  
I hope you can help me.  
Thanks

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [July 18, 2016, 11:51am UTC](https://discuss.elastic.co/t/custom-log-level-log4j/55733/2 "2016-07-18T11:51:18Z")

</div>

How are the messages sent to Logstash?

---

<div class="post-metadata">

**Author:** ![pat123](https://avatars.discourse-cdn.com/v4/letter/p/8c91f0/32.png) [@pat123](https://discuss.elastic.co/u/pat123)\
**Post date:** [July 18, 2016, 12:15pm UTC](https://discuss.elastic.co/t/custom-log-level-log4j/55733/3 "2016-07-18T12:15:23Z")

</div>

input {  
log4j {  
type =\> "log4j"  
port =\> 5000  
mode =\> "server"  
}  
}  
here is the input of my logstash.config file.

log4j.rootLogger=INFO, server, stdout  
log4j.appender.server=org.apache.log4j.net.SocketAppender  
log4j.appender.server.Port=5000  
log4j.appender.server.RemoteHost=10.97.162.58  
log4j.appender.server.ReconnectionDelay=10000

and my properties file.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [July 18, 2016, 3:45pm UTC](https://discuss.elastic.co/t/custom-log-level-log4j/55733/4 "2016-07-18T15:45:12Z")

</div>

Yeah, I don't know of the log4j input supports custom log levels. I'd look in the Logstash logs for clues, raising the log level if needed.

---

<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:** [July 6, 2017, 4:47am UTC](https://discuss.elastic.co/t/custom-log-level-log4j/55733/5 "2017-07-06T04:47:35Z")

</div>


