@@ -0,0 +1,1680 @@
+/*%0A * Seldon -- open source prediction engine%0A * =======================================%0A * Copyright 2011-2015 Seldon Technologies Ltd and Rummble Ltd (http://www.seldon.io/)%0A *%0A **********************************************************************************************%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at       %0A *%0A *    http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A *%0A ********************************************************************************************** %0A*/%0Apackage io.seldon.api.logging;%0A%0Aimport io.seldon.prediction.PredictionsResult;%0A%0Aimport org.apache.log4j.Logger;%0Aimport org.codehaus.jackson.JsonNode;%0Aimport org.codehaus.jackson.map.ObjectMapper;%0Aimport org.codehaus.jackson.node.ObjectNode;%0A%0A%0Apublic class PredictLogger %7B%0A%0A%09private static Logger predictLogger = Logger.getLogger( %22PredictLogger%22 );%0A%09%0A%09public static void log(String algKey,JsonNode input,PredictionsResult response)%0A%09%7B%0A%09%09ObjectMapper mapper = new ObjectMapper();%0A%09%09JsonNode prediction = mapper.valueToTree(response);%0A%09%09ObjectNode topNode = mapper.createObjectNode();%0A%09%09topNode.put(%22input%22, input);%0A%09%09topNode.put(%22prediction%22, prediction);%0A%09%09topNode.put(%22algorithm%22, algKey);%0A%09%09predictLogger.info(topNode.toString());%0A%09%7D%0A%7D%0A

add model name to micro-service prediction response and log predictions to file