net.logstash.log4j.data.HostData Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jsonevent-layout Show documentation
Show all versions of jsonevent-layout Show documentation
Log4j pattern layout that conforms to the logstash json_event format
package net.logstash.log4j.data;
import java.net.UnknownHostException;
public class HostData {
public String hostName;
public String getHostName() {
return hostName;
}
public void setHostName(String hostName) {
this.hostName = hostName;
}
public HostData() {
try {
this.hostName = java.net.InetAddress.getLocalHost().getHostName();
} catch (UnknownHostException e) {
setHostName("unknown-host");
}
}
}