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

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"?>
    <Console name="out" target="SYSTEM_OUT">  
        <PatternLayout pattern="%d{yyyy-MMM-dd HH:mm:ss} [%t] %-5p: %m%n"></PatternLayout>  
    <Socket name="A1" host="" port="5000">
    <root level="trace">  
        <AppenderRef ref="out" />
        <AppenderRef ref="A1" />

Logstash conf: (logstash version: 5.3.2)
input {
log4j {

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

1 Like

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