logstash icon indicating copy to clipboard operation
logstash copied to clipboard

log4j:WARN Please initialize the log4j system properly

Open robin820224 opened this issue 10 years ago • 8 comments

I have installed logstash2.2.2 and elasticsearch2.1.1 in centos7. When I used "service logstash configtest", I have got log4j WARM:

[root@iZ25g5gvvtgZ bin]# service logstash configtest log4j:WARN No appenders could be found for logger (org.apache.http.client.protocol.RequestAuthCache). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. Configuration OK

The follow is my conf file: input { log4j { mode => "server" host => "localhost" port => 4561 } } output { elasticsearch { hosts => "localhost:9200" } }

robin820224 avatar Feb 19 '16 08:02 robin820224

You can ignore this warning; it is meaningless.

We will make it go away in a future release.

jordansissel avatar Feb 19 '16 15:02 jordansissel

After I start logstash service, it seems that logstash had listened on tcp 4561 port. I want to known whether logstash could support UDP protocal? If can, how should I config the conf file for udp protocal?

[root@iZ25g5gvvtgZ conf.d]# netstat -ant | grep 4561 tcp 0 0 0.0.0.0:4561 0.0.0.0:* LISTEN

robin820224 avatar Feb 22 '16 08:02 robin820224

Hi folks, try to upgrade Logstash to 2.2.2 from 2.1.1 today, received same message. 2016-02-24-01-logstash-2 2 2-kafka-latency-05 Regardless these messages, I have got another problem here: Logstash take 4 minutes to startup. Normally, it only take seconds to complete the collection(read the log, transfer them to kafka broker). But with version 2.2.2., it will take 2 minutes to read the logs, and spend another 2 minutes to transfer them to kafka broker, pasting test time stamp as below: 02:42PM - Stop logstash service and remove sincedb file manually 02:44PM - Start logstash service 02:46PM - Logstash start to read logs 02:48PM - sincedb file been created, Logstash transfer the logs to Kafka broker(logs transfer to ES immediately, we can check them on Kibana) 2016-02-24-01-logstash-2 2 2-kafka-latency-03 02:54PM - Stop logstash service, Kafka log throw exception as below: 2016-02-24-01-logstash-2 2 2-kafka-latency-04

Not sure how to debug the root cause further, wondering if anyone got same problem like me. Considering this unstable factor, I will use current version till stable version been released.

zhoufwind avatar Feb 24 '16 07:02 zhoufwind

@zhoufwind is this issue only with the Kafka broker? Does logstash startup quickly with other configs? That info would help us greatly. If it is a Kafka issue could report the bug here: https://github.com/logstash-plugins/logstash-input-kafka

andrewvc avatar Feb 26 '16 16:02 andrewvc

@andrewvc sorry for late responding on it. Good news is I cannot reproduce same issue anymore when I try to debug on other machines(both Linux and Windows) today, even origin one(10.10.10.66) startup quickly as well. One obviously symptom is: When I stop or restart logstash service, java process didn't been killed actually. After I killed logstash & java process manually, upgrade logstash latest version(2.2.2 from 2.1.1), start logstash process again, everything working perfect then. So, Logstash-2.2.2 is working perfect right now and turns out it's my personal problem, going on update them next week and thanks all for taking care of my mistaken, sincerely.

zhoufwind avatar Feb 28 '16 07:02 zhoufwind

Looks like #4111 cat /var/log/logstash/logstash.err

log4j:WARN No appenders could be found for logger (io.netty.util.internal.logging.InternalLoggerFactory).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

With logtash 2.4.0, jdk 1.8.0_101 and centos 7.2

glmrenard avatar Oct 20 '16 07:10 glmrenard

Assuming the original intent of this issue, I am closing this issue as resolved in 5.6.0 and 6.0.0

log4j:WARN Please initialize the log4j system properly

and

You can ignore this warning; it is meaningless.

and

We will make it go away in a future release.

That future release will be 5.6.0 and 6.0.0, resolved as part of https://github.com/elastic/logstash/issues/7526

jakelandis avatar Jul 06 '17 17:07 jakelandis

May be you have not kept the log4j.properties file inside src/main/resource folder.

chandan188 avatar Apr 30 '19 06:04 chandan188