connect Logstash 1.5.0 with log4j of several servers

若如初见. 提交于 2020-01-17 04:25:07

问题


I'm trying to connect logstash (Version 1.5.0) to get logs of services (that run on apache-tomcat). These logs are log4j.

I use this config for logstash:

input { 
  log4j {
    mode => server
    host => localhost
    port => 4560
    type => "log4j"
  }
}...

and in my service' log4j.xml I've set my SocketAppender:

<appender name="OHADS" class="org.apache.log4j.net.SocketAppender">
    <param name="port" value="4560" />
    <param name="remoteHost" value="localhost" />
</appender>

It works fine.

The questions:

  1. I want logstash to collect logs not from my 'localhost', but from other tomcats, from other machines, as well. How can I do that? when I tried to put in the "host" (in logstash config) something other than localhost (or the IP of the local machine), i got error on startup:

"Cannot assign requested address - bind - Cannot assign requested address".

  1. How can I connect it to several IPs simultanously?

any ideas?

来源:https://stackoverflow.com/questions/30624467/connect-logstash-1-5-0-with-log4j-of-several-servers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!