Skip to content
This repository was archived by the owner on Jun 29, 2023. It is now read-only.
This repository was archived by the owner on Jun 29, 2023. It is now read-only.

InetAddress cached #77

@sergiomahs

Description

@sergiomahs

Whenever the first log is sent, the variable hostname is cached in GelfTCPSender. If for example the graylog server is in the cloud and the ip changes, the hostname won't be the correct one anymore, so it has to be recalculated again.

Our workaround is to find the hostname everytime that a log is appended and the Socket is null.

protected Socket createSocket() throws IOException { Socket socket = new Socket(); socket.setSoTimeout(readTimeoutMs); socket.setKeepAlive(keepAlive); InetAddress hostname = InetAddress.getByName(host); socket.connect(new InetSocketAddress(hostname, port), connectTimeoutMs); return socket; }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions