mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
- report the host/port that is related to EADDRINUSE (LOGSTASH-831)
This commit is contained in:
parent
2d43825aea
commit
3761978c14
1 changed files with 7 additions and 1 deletions
|
@ -42,7 +42,13 @@ class LogStash::Inputs::Tcp < LogStash::Inputs::Base
|
|||
def register
|
||||
if server?
|
||||
@logger.info("Starting tcp input listener", :address => "#{@host}:#{@port}")
|
||||
@server_socket = TCPServer.new(@host, @port)
|
||||
begin
|
||||
@server_socket = TCPServer.new(@host, @port)
|
||||
rescue Errno::EADDRINUSE
|
||||
@logger.error("Could not start TCP server: Address in use",
|
||||
:host => @host, :port => @port)
|
||||
raise
|
||||
end
|
||||
end
|
||||
end # def register
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue