Skip to content
This repository was archived by the owner on May 31, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/main/java/me/moocar/logbackgelf/GelfAppender.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
import java.util.HashMap;
import java.util.Map;

import static me.moocar.logbackgelf.util.InternetUtils.*;
import static me.moocar.logbackgelf.InternetUtils.getInetAddress;
import static me.moocar.logbackgelf.InternetUtils.getLocalHostName;

/**
* Responsible for Formatting a log event and sending it to a Graylog2 Server. Note that you can't swap in a different
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/me/moocar/logbackgelf/GelfLayout.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import java.util.HashMap;
import java.util.Map;

import static me.moocar.logbackgelf.util.InternetUtils.getLocalHostName;
import static me.moocar.logbackgelf.InternetUtils.getLocalHostName;

public class GelfLayout extends LayoutBase<ILoggingEvent> {
// The following are configurable via logback configuration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
package me.moocar.logbackgelf.util;

/*
* Copyright (c) 2013 OCLC, Inc. All Rights Reserved.
*
* OCLC proprietary information: the enclosed materials contain proprietary information of OCLC Online Computer
* Library Center, Inc. and shall not be disclosed in whole or in any part to any third party or used by any person
* for any purpose, without written consent of OCLC, Inc. Duplication of any portion of these materials shall include
* this notice.
*/
package me.moocar.logbackgelf;

import java.net.InetAddress;
import java.net.NetworkInterface;
Expand All @@ -34,9 +25,11 @@ public static String getLocalHostName() throws SocketException, UnknownHostExcep
}
} catch (UnknownHostException e) {
NetworkInterface networkInterface = NetworkInterface.getNetworkInterfaces().nextElement();
if (networkInterface == null) throw e;
if (networkInterface == null)
throw e;
InetAddress ipAddress = networkInterface.getInetAddresses().nextElement();
if (ipAddress == null) throw e;
if (ipAddress == null)
throw e;
return ipAddress.getHostAddress();
}
}
Expand Down
1 change: 0 additions & 1 deletion src/test/java/me/moocar/logbackgelf/IntegrationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.net.UnknownHostException;
import java.util.Random;

import static me.moocar.logbackgelf.util.InternetUtils.getLocalHostName;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.moocar.logbackgelf.util;
package me.moocar.logbackgelf;

import java.net.InetAddress;
import java.net.SocketException;
Expand Down