public String getSegmentedSubject(final ExtLogRecord record) { final String hostName = record.getHostName(); final int idx = hostName.indexOf('.'); return idx == -1 ? hostName :hostName.substring(0, idx); } };
public String getSegmentedSubject(final ExtLogRecord record) { final String hostName = record.getHostName(); // Check for a specified precision. This is not passed to the constructor because we want truncate // segments from the right intsead of the left. if (precision != null && PRECISION_INT_PATTERN.matcher(precision).matches()) { int count = Integer.parseInt(precision); int end = 0; for (int i = 0; i < hostName.length(); i++) { // If we've got a dot we're at a new segment if (hostName.charAt(i) == '.') { count--; end = i; } // We've reached the precision we want if (count == 0) { break; } } if (end != 0 && count == 0) { return hostName.substring(0, end); } } return hostName; } };
final String recordHostName = record.getHostName(); if (hostname != null) { buffer.appendUSASCII(hostname).append(' ');
final String recordHostName = record.getHostName(); if (hostname != null) { buffer.appendPrintUSASCII(hostname, 255).append(' ');
.add(getKey(Key.NDC), record.getNdc()); if (isNotNullOrEmpty(record.getHostName())) { generator.add(getKey(Key.HOST_NAME), record.getHostName());