From 094be3c28b00c0d197c653857da0604eec36e0bb Mon Sep 17 00:00:00 2001 From: David Roberts Date: Wed, 1 Mar 2017 09:33:30 +0000 Subject: [PATCH] [ML] Put C++ process/PID and file@line in square brackets (elastic/x-pack-elasticsearch#671) This is the Elastic convention, and also makes it clearer where the actual log message from the C++ starts Original commit: elastic/x-pack-elasticsearch@dc9aeefb0882d787d2d4d648b93ccd335cb44868 --- .../xpack/ml/job/process/logging/CppLogMessageHandler.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugin/src/main/java/org/elasticsearch/xpack/ml/job/process/logging/CppLogMessageHandler.java b/plugin/src/main/java/org/elasticsearch/xpack/ml/job/process/logging/CppLogMessageHandler.java index 3b1756fcdac..b95c0a45a54 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/ml/job/process/logging/CppLogMessageHandler.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/ml/job/process/logging/CppLogMessageHandler.java @@ -215,9 +215,10 @@ public class CppLogMessageHandler implements Closeable { } // TODO: Is there a way to preserve the original timestamp when re-logging? if (jobId != null) { - LOGGER.log(level, "[{}] {}/{} {}@{} {}", jobId, msg.getLogger(), latestPid, msg.getFile(), msg.getLine(), latestMessage); + LOGGER.log(level, "[{}] [{}/{}] [{}@{}] {}", jobId, msg.getLogger(), latestPid, msg.getFile(), msg.getLine(), + latestMessage); } else { - LOGGER.log(level, "{}/{} {}@{} {}", msg.getLogger(), latestPid, msg.getFile(), msg.getLine(), latestMessage); + LOGGER.log(level, "[{}/{}] [{}@{}] {}", msg.getLogger(), latestPid, msg.getFile(), msg.getLine(), latestMessage); } // TODO: Could send the message for indexing instead of or as well as logging it } catch (IOException e) {