# Log4j -\>Logstash problem with "LocationInfo is not allowed" exception

**URL:** <https://discuss.elastic.co/t/log4j-logstash-problem-with-locationinfo-is-not-allowed-exception/85054>\
**Category:** Logstash\
**Created:** [May 9, 2017, 9:52am UTC](https://discuss.elastic.co/t/log4j-logstash-problem-with-locationinfo-is-not-allowed-exception/85054 "2017-05-09T09:52:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![iknowabc](https://avatars.discourse-cdn.com/v4/letter/i/f6c823/32.png) [@iknowabc](https://discuss.elastic.co/u/iknowabc)\
**Post date:** [May 9, 2017, 9:52am UTC](https://discuss.elastic.co/t/log4j-logstash-problem-with-locationinfo-is-not-allowed-exception/85054/1 "2017-05-09T09:52:19Z")

</div>

When I use log4j sends log event to Logstash , a problem ("exception=\>java.io.InvalidObjectException: Object type org.apache.log4j.spi.LocationInfo is not allowed.") is encountered. Anyone could help me ? thanks!  
BTW: Both log4j 1.x and log4j 2.x encountered the same problem...

Log4j conf:

\<?xml version="1.0" encoding="UTF-8"?\> 

```
<Appenders>
    <Console name="out" target="SYSTEM_OUT">  
        <PatternLayout pattern="%d{yyyy-MMM-dd HH:mm:ss} [%t] %-5p: %m%n"></PatternLayout>  
    </Console>
    <Socket name="A1" host="10.10.11.12" port="5000">
        <JSONLayout/>
    </Socket>
</Appenders>
<Loggers>
    <root level="trace">  
        <AppenderRef ref="out" />
        <AppenderRef ref="A1" />
    </root>  
</Loggers>  

```

Logstash conf: (logstash version: 5.3.2)  
input {  
log4j {  
host=\>"10.10.11.12"  
port=\>5000  
}  
}

output {  
elasticsearch {  
hosts =\>"10.10.11.13:9200"  
index =\>"log4j-message-%{+YYYY.MM.dd}"  
}  
stdout { codec =\> rubydebug }

---

<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:** [June 6, 2017, 10:01am UTC](https://discuss.elastic.co/t/log4j-logstash-problem-with-locationinfo-is-not-allowed-exception/85054/2 "2017-06-06T10:01:39Z")

</div>

Closed on June 6, 2017, 10:01am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
