You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ze...@apache.org on 2023/10/26 21:01:31 UTC
[streampipes] branch 2088-remove-module-streampipes-logging updated: refactor(#2088): Remove module streampipes-logging
This is an automated email from the ASF dual-hosted git repository.
zehnder pushed a commit to branch 2088-remove-module-streampipes-logging
in repository https://gitbox.apache.org/repos/asf/streampipes.git
The following commit(s) were added to refs/heads/2088-remove-module-streampipes-logging by this push:
new f2d6b85e4 refactor(#2088): Remove module streampipes-logging
f2d6b85e4 is described below
commit f2d6b85e48f3397d08c685e56d2cc229854c9200
Author: Philipp Zehnder <te...@users.noreply.github.com>
AuthorDate: Thu Oct 26 23:01:18 2023 +0200
refactor(#2088): Remove module streampipes-logging
---
pom.xml | 1 -
.../streampipes-connectors-influx/pom.xml | 6 ++
.../connectors/influx/sink/InfluxDbSink.java | 9 +--
.../urldereferencing/UrlDereferencing.java | 3 -
.../inverter/BooleanInverterProcessor.java | 3 -
.../counter/StringCounterProcessor.java | 4 --
.../state/StringToStateProcessor.java | 4 --
.../stringoperator/timer/StringTimerProcessor.java | 4 --
.../sinks/databases/jvm/jdbcclient/JdbcClient.java | 30 +++++-----
.../sinks/databases/jvm/postgresql/PostgreSql.java | 16 +++--
streampipes-logging/pom.xml | 46 ---------------
.../apache/streampipes/logging/LoggerFactory.java | 31 ----------
.../org/apache/streampipes/logging/api/Logger.java | 34 -----------
.../logging/impl/EventStatisticLogger.java | 41 -------------
.../apache/streampipes/logging/impl/PeLogger.java | 62 -------------------
.../org/apache/streampipes/logging/model/Log.java | 69 ----------------------
.../streampipes/logging/model/LogRequest.java | 50 ----------------
streampipes-model/pom.xml | 5 --
.../model/base/InvocableStreamPipesEntity.java | 7 ---
streampipes-service-discovery-consul/pom.xml | 5 --
.../wrapper/kafka/converter/JsonToMapFormat.java | 2 -
21 files changed, 33 insertions(+), 399 deletions(-)
diff --git a/pom.xml b/pom.xml
index e2b7ffc5b..7a3f55cae 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1339,7 +1339,6 @@
<module>streampipes-dataformat-smile</module>
<module>streampipes-extensions</module>
<module>streampipes-integration-tests</module>
- <module>streampipes-logging</module>
<module>streampipes-mail</module>
<module>streampipes-maven-plugin</module>
<module>streampipes-measurement-units</module>
diff --git a/streampipes-extensions/streampipes-connectors-influx/pom.xml b/streampipes-extensions/streampipes-connectors-influx/pom.xml
index 01caf7b57..eff4895e5 100644
--- a/streampipes-extensions/streampipes-connectors-influx/pom.xml
+++ b/streampipes-extensions/streampipes-connectors-influx/pom.xml
@@ -44,10 +44,16 @@
<artifactId>streampipes-wrapper-standalone</artifactId>
<version>0.93.0-SNAPSHOT</version>
</dependency>
+
+ <!-- External dependencies -->
<dependency>
<groupId>org.influxdb</groupId>
<artifactId>influxdb-java</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
</dependencies>
diff --git a/streampipes-extensions/streampipes-connectors-influx/src/main/java/org/apache/streampipes/extensions/connectors/influx/sink/InfluxDbSink.java b/streampipes-extensions/streampipes-connectors-influx/src/main/java/org/apache/streampipes/extensions/connectors/influx/sink/InfluxDbSink.java
index 78946c810..6e169a364 100644
--- a/streampipes-extensions/streampipes-connectors-influx/src/main/java/org/apache/streampipes/extensions/connectors/influx/sink/InfluxDbSink.java
+++ b/streampipes-extensions/streampipes-connectors-influx/src/main/java/org/apache/streampipes/extensions/connectors/influx/sink/InfluxDbSink.java
@@ -21,7 +21,6 @@ package org.apache.streampipes.extensions.connectors.influx.sink;
import org.apache.streampipes.commons.exceptions.SpRuntimeException;
import org.apache.streampipes.extensions.api.pe.context.EventSinkRuntimeContext;
import org.apache.streampipes.extensions.connectors.influx.shared.InfluxConfigs;
-import org.apache.streampipes.logging.api.Logger;
import org.apache.streampipes.model.DataSinkType;
import org.apache.streampipes.model.graph.DataSinkDescription;
import org.apache.streampipes.model.runtime.Event;
@@ -35,6 +34,9 @@ import org.apache.streampipes.sdk.utils.Assets;
import org.apache.streampipes.wrapper.params.compat.SinkParams;
import org.apache.streampipes.wrapper.standalone.StreamPipesDataSink;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import static org.apache.streampipes.extensions.connectors.influx.shared.InfluxKeys.BATCH_INTERVAL_ACTIONS_KEY;
import static org.apache.streampipes.extensions.connectors.influx.shared.InfluxKeys.DATABASE_MEASUREMENT_KEY;
import static org.apache.streampipes.extensions.connectors.influx.shared.InfluxKeys.MAX_FLUSH_DURATION_KEY;
@@ -42,17 +44,16 @@ import static org.apache.streampipes.extensions.connectors.influx.shared.InfluxK
public class InfluxDbSink extends StreamPipesDataSink {
+ private static final Logger LOG = LoggerFactory.getLogger(InfluxDbSink.class);
private InfluxDbClient influxDbClient;
- private static Logger log;
@Override
public void onInvocation(SinkParams parameters,
EventSinkRuntimeContext runtimeContext) throws SpRuntimeException {
var extractor = parameters.extractor();
- log = parameters.getModel().getLogger(InfluxDbSink.class);
var connectionSettings = InfluxConfigs.fromExtractor(extractor);
String measureName = extractor.singleValueParameter(DATABASE_MEASUREMENT_KEY, String.class);
@@ -76,7 +77,7 @@ public class InfluxDbSink extends StreamPipesDataSink {
try {
influxDbClient.save(event);
} catch (SpRuntimeException e) {
- log.error(e.getMessage());
+ LOG.error(e.getMessage());
}
}
diff --git a/streampipes-extensions/streampipes-pipeline-elements-experimental-flink/src/main/java/org/apache/streampipes/pe/flink/processor/urldereferencing/UrlDereferencing.java b/streampipes-extensions/streampipes-pipeline-elements-experimental-flink/src/main/java/org/apache/streampipes/pe/flink/processor/urldereferencing/UrlDereferencing.java
index c21974b80..b986cac6b 100644
--- a/streampipes-extensions/streampipes-pipeline-elements-experimental-flink/src/main/java/org/apache/streampipes/pe/flink/processor/urldereferencing/UrlDereferencing.java
+++ b/streampipes-extensions/streampipes-pipeline-elements-experimental-flink/src/main/java/org/apache/streampipes/pe/flink/processor/urldereferencing/UrlDereferencing.java
@@ -18,7 +18,6 @@
package org.apache.streampipes.pe.flink.processor.urldereferencing;
-import org.apache.streampipes.logging.api.Logger;
import org.apache.streampipes.model.graph.DataProcessorInvocation;
import org.apache.streampipes.model.runtime.Event;
@@ -31,12 +30,10 @@ public class UrlDereferencing implements FlatMapFunction<Event, Event> {
private String urlString;
private String appendHtml;
- private Logger logger;
public UrlDereferencing(String urlString, String appendHtml, DataProcessorInvocation graph) {
this.urlString = urlString;
this.appendHtml = appendHtml;
- this.logger = graph.getLogger(UrlDereferencing.class);
}
@Override
diff --git a/streampipes-extensions/streampipes-processors-transformation-jvm/src/main/java/org/apache/streampipes/processors/transformation/jvm/processor/booloperator/inverter/BooleanInverterProcessor.java b/streampipes-extensions/streampipes-processors-transformation-jvm/src/main/java/org/apache/streampipes/processors/transformation/jvm/processor/booloperator/inverter/BooleanInverterProcessor.java
index 17f938f5a..56186a508 100644
--- a/streampipes-extensions/streampipes-processors-transformation-jvm/src/main/java/org/apache/streampipes/processors/transformation/jvm/processor/booloperator/inverter/BooleanInverterProcessor.java
+++ b/streampipes-extensions/streampipes-processors-transformation-jvm/src/main/java/org/apache/streampipes/processors/transformation/jvm/processor/booloperator/inverter/BooleanInverterProcessor.java
@@ -21,7 +21,6 @@ package org.apache.streampipes.processors.transformation.jvm.processor.boolopera
import org.apache.streampipes.commons.exceptions.SpRuntimeException;
import org.apache.streampipes.extensions.api.pe.context.EventProcessorRuntimeContext;
import org.apache.streampipes.extensions.api.pe.routing.SpOutputCollector;
-import org.apache.streampipes.logging.api.Logger;
import org.apache.streampipes.model.DataProcessorType;
import org.apache.streampipes.model.graph.DataProcessorDescription;
import org.apache.streampipes.model.runtime.Event;
@@ -39,7 +38,6 @@ import org.apache.streampipes.wrapper.standalone.StreamPipesDataProcessor;
public class BooleanInverterProcessor extends StreamPipesDataProcessor {
public static final String INVERT_FIELD_ID = "invert-field";
- private static Logger log;
private String invertFieldName;
@Override
public DataProcessorDescription declareModel() {
@@ -62,7 +60,6 @@ public class BooleanInverterProcessor extends StreamPipesDataProcessor {
SpOutputCollector spOutputCollector,
EventProcessorRuntimeContext runtimeContext) throws SpRuntimeException {
ProcessingElementParameterExtractor extractor = parameters.extractor();
- log = parameters.getGraph().getLogger(BooleanInverterProcessor.class);
this.invertFieldName = extractor.mappingPropertyValue(INVERT_FIELD_ID);
}
diff --git a/streampipes-extensions/streampipes-processors-transformation-jvm/src/main/java/org/apache/streampipes/processors/transformation/jvm/processor/stringoperator/counter/StringCounterProcessor.java b/streampipes-extensions/streampipes-processors-transformation-jvm/src/main/java/org/apache/streampipes/processors/transformation/jvm/processor/stringoperator/counter/StringCounterProcessor.java
index 27e7220b5..8c4878827 100644
--- a/streampipes-extensions/streampipes-processors-transformation-jvm/src/main/java/org/apache/streampipes/processors/transformation/jvm/processor/stringoperator/counter/StringCounterProcessor.java
+++ b/streampipes-extensions/streampipes-processors-transformation-jvm/src/main/java/org/apache/streampipes/processors/transformation/jvm/processor/stringoperator/counter/StringCounterProcessor.java
@@ -21,7 +21,6 @@ package org.apache.streampipes.processors.transformation.jvm.processor.stringope
import org.apache.streampipes.commons.exceptions.SpRuntimeException;
import org.apache.streampipes.extensions.api.pe.context.EventProcessorRuntimeContext;
import org.apache.streampipes.extensions.api.pe.routing.SpOutputCollector;
-import org.apache.streampipes.logging.api.Logger;
import org.apache.streampipes.model.DataProcessorType;
import org.apache.streampipes.model.graph.DataProcessorDescription;
import org.apache.streampipes.model.runtime.Event;
@@ -42,8 +41,6 @@ import java.util.HashMap;
public class StringCounterProcessor extends StreamPipesDataProcessor {
- private static Logger log;
-
protected static final String FIELD_ID = "field";
private static final String COUNT_FIELD_ID = "countField";
private static final String CHANGE_FROM_FIELD_ID = "changeFromField";
@@ -85,7 +82,6 @@ public class StringCounterProcessor extends StreamPipesDataProcessor {
public void onInvocation(ProcessorParams parameters,
SpOutputCollector spOutputCollector,
EventProcessorRuntimeContext runtimeContext) throws SpRuntimeException {
- log = parameters.getGraph().getLogger(StringCounterProcessor.class);
ProcessingElementParameterExtractor extractor = parameters.extractor();
this.selectedFieldName = extractor.mappingPropertyValue(FIELD_ID);
this.fieldValueOfLastEvent = "";
diff --git a/streampipes-extensions/streampipes-processors-transformation-jvm/src/main/java/org/apache/streampipes/processors/transformation/jvm/processor/stringoperator/state/StringToStateProcessor.java b/streampipes-extensions/streampipes-processors-transformation-jvm/src/main/java/org/apache/streampipes/processors/transformation/jvm/processor/stringoperator/state/StringToStateProcessor.java
index 3dfd95dea..d9804c0a3 100644
--- a/streampipes-extensions/streampipes-processors-transformation-jvm/src/main/java/org/apache/streampipes/processors/transformation/jvm/processor/stringoperator/state/StringToStateProcessor.java
+++ b/streampipes-extensions/streampipes-processors-transformation-jvm/src/main/java/org/apache/streampipes/processors/transformation/jvm/processor/stringoperator/state/StringToStateProcessor.java
@@ -21,7 +21,6 @@ package org.apache.streampipes.processors.transformation.jvm.processor.stringope
import org.apache.streampipes.commons.exceptions.SpRuntimeException;
import org.apache.streampipes.extensions.api.pe.context.EventProcessorRuntimeContext;
import org.apache.streampipes.extensions.api.pe.routing.SpOutputCollector;
-import org.apache.streampipes.logging.api.Logger;
import org.apache.streampipes.model.DataProcessorType;
import org.apache.streampipes.model.graph.DataProcessorDescription;
import org.apache.streampipes.model.runtime.Event;
@@ -45,8 +44,6 @@ import java.util.List;
public class StringToStateProcessor extends StreamPipesDataProcessor {
- private static Logger log;
-
public static final String STRING_STATE_FIELD = "string_state_field";
public static final String CURRENT_STATE = "current_state";
@@ -74,7 +71,6 @@ public class StringToStateProcessor extends StreamPipesDataProcessor {
public void onInvocation(ProcessorParams parameters,
SpOutputCollector spOutputCollector,
EventProcessorRuntimeContext runtimeContext) throws SpRuntimeException {
- log = parameters.getGraph().getLogger(StringToStateProcessor.class);
ProcessingElementParameterExtractor extractor = parameters.extractor();
this.stateFields = extractor.mappingPropertyValues(STRING_STATE_FIELD);
}
diff --git a/streampipes-extensions/streampipes-processors-transformation-jvm/src/main/java/org/apache/streampipes/processors/transformation/jvm/processor/stringoperator/timer/StringTimerProcessor.java b/streampipes-extensions/streampipes-processors-transformation-jvm/src/main/java/org/apache/streampipes/processors/transformation/jvm/processor/stringoperator/timer/StringTimerProcessor.java
index 65de862a0..c65963c7a 100644
--- a/streampipes-extensions/streampipes-processors-transformation-jvm/src/main/java/org/apache/streampipes/processors/transformation/jvm/processor/stringoperator/timer/StringTimerProcessor.java
+++ b/streampipes-extensions/streampipes-processors-transformation-jvm/src/main/java/org/apache/streampipes/processors/transformation/jvm/processor/stringoperator/timer/StringTimerProcessor.java
@@ -21,7 +21,6 @@ package org.apache.streampipes.processors.transformation.jvm.processor.stringope
import org.apache.streampipes.commons.exceptions.SpRuntimeException;
import org.apache.streampipes.extensions.api.pe.context.EventProcessorRuntimeContext;
import org.apache.streampipes.extensions.api.pe.routing.SpOutputCollector;
-import org.apache.streampipes.logging.api.Logger;
import org.apache.streampipes.model.DataProcessorType;
import org.apache.streampipes.model.graph.DataProcessorDescription;
import org.apache.streampipes.model.runtime.Event;
@@ -43,8 +42,6 @@ import java.util.Objects;
public class StringTimerProcessor extends StreamPipesDataProcessor {
- private static Logger log;
-
public static final String FIELD_ID = "field";
public static final String MEASURED_TIME_ID = "measuredTime";
public static final String FIELD_VALUE_ID = "fieldValue";
@@ -98,7 +95,6 @@ public class StringTimerProcessor extends StreamPipesDataProcessor {
public void onInvocation(ProcessorParams parameters,
SpOutputCollector spOutputCollector,
EventProcessorRuntimeContext runtimeContext) throws SpRuntimeException {
- log = parameters.getGraph().getLogger(StringTimerProcessor.class);
ProcessingElementParameterExtractor extractor = parameters.extractor();
this.selectedFieldName = extractor.mappingPropertyValue(FIELD_ID);
diff --git a/streampipes-extensions/streampipes-sinks-databases-jvm/src/main/java/org/apache/streampipes/sinks/databases/jvm/jdbcclient/JdbcClient.java b/streampipes-extensions/streampipes-sinks-databases-jvm/src/main/java/org/apache/streampipes/sinks/databases/jvm/jdbcclient/JdbcClient.java
index 41ff19600..b62f020c7 100644
--- a/streampipes-extensions/streampipes-sinks-databases-jvm/src/main/java/org/apache/streampipes/sinks/databases/jvm/jdbcclient/JdbcClient.java
+++ b/streampipes-extensions/streampipes-sinks-databases-jvm/src/main/java/org/apache/streampipes/sinks/databases/jvm/jdbcclient/JdbcClient.java
@@ -19,7 +19,6 @@
package org.apache.streampipes.sinks.databases.jvm.jdbcclient;
import org.apache.streampipes.commons.exceptions.SpRuntimeException;
-import org.apache.streampipes.logging.api.Logger;
import org.apache.streampipes.model.runtime.Event;
import org.apache.streampipes.model.schema.EventSchema;
import org.apache.streampipes.sinks.databases.jvm.jdbcclient.model.DbDescription;
@@ -29,6 +28,9 @@ import org.apache.streampipes.sinks.databases.jvm.jdbcclient.model.SupportedDbEn
import org.apache.streampipes.sinks.databases.jvm.jdbcclient.model.TableDescription;
import org.apache.streampipes.sinks.databases.jvm.jdbcclient.utils.SQLStatementUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
@@ -38,6 +40,8 @@ import java.util.Map;
public class JdbcClient {
+ private static final Logger LOG = LoggerFactory.getLogger(JdbcClient.class);
+
protected DbDescription dbDescription;
protected TableDescription tableDescription;
@@ -46,8 +50,6 @@ public class JdbcClient {
protected StatementHandler statementHandler;
- protected Logger logger;
-
/**
* A wrapper class for all supported SQL data types (INT, BIGINT, FLOAT, DOUBLE, VARCHAR(255)).
* If no matching type is found, it is interpreted as a String (VARCHAR(255))
@@ -57,12 +59,10 @@ public class JdbcClient {
protected void initializeJdbc(EventSchema eventSchema,
JdbcConnectionParameters connectionParameters,
- SupportedDbEngines dbEngine,
- Logger logger) throws SpRuntimeException {
+ SupportedDbEngines dbEngine) throws SpRuntimeException {
this.dbDescription = new DbDescription(connectionParameters, dbEngine);
this.tableDescription = new TableDescription(connectionParameters.getDbTable(), eventSchema);
this.statementHandler = new StatementHandler(null, null);
- this.logger = logger;
try {
Class.forName(this.dbDescription.getDriverName());
} catch (ClassNotFoundException e) {
@@ -115,9 +115,9 @@ public class JdbcClient {
private void connectWithSSL(String host, int port, String databaseName) throws SpRuntimeException {
String url =
"jdbc:" + this.dbDescription.getEngine().getUrlName() + "://" + host + ":" + port + "/" + databaseName
- + "?user="
- + this.dbDescription.getUsername() + "&password=" + this.dbDescription.getPassword()
- + "&ssl=true&sslfactory=" + this.dbDescription.getSslFactory() + "&sslmode=require";
+ + "?user="
+ + this.dbDescription.getUsername() + "&password=" + this.dbDescription.getPassword()
+ + "&ssl=true&sslfactory=" + this.dbDescription.getSslFactory() + "&sslmode=require";
try {
connection = DriverManager.getConnection(url);
ensureDatabaseExists(databaseName);
@@ -149,7 +149,7 @@ public class JdbcClient {
// Checks whether the database already exists (using catalogs has not worked with postgres)
this.statementHandler.setStatement(connection.createStatement());
this.statementHandler.statement.executeUpdate(createStatement + databaseName + ";");
- logger.info("Created new database '" + databaseName + "'");
+ LOG.info("Created new database '" + databaseName + "'");
} catch (SQLException e1) {
if (!e1.getSQLState().substring(0, 2).equals("42")) {
throw new SpRuntimeException("Error while creating database: " + e1.getMessage());
@@ -214,7 +214,7 @@ public class JdbcClient {
if (e.getSQLState().substring(0, 2).equals("42")) {
// If the table does not exists (because it got deleted or something, will cause the error
// code "42") we will try to create a new one. Otherwise we do not handle the exception.
- logger.warn("Table '" + this.tableDescription.getName() + "' was unexpectedly not found and gets recreated.");
+ LOG.warn("Table '" + this.tableDescription.getName() + "' was unexpectedly not found and gets recreated.");
this.tableDescription.setTableMissing();
createTable();
this.tableDescription.setTableExists();
@@ -266,7 +266,7 @@ public class JdbcClient {
}
} catch (SQLException e) {
error = true;
- logger.warn("Exception when closing the statement: " + e.getMessage());
+ LOG.warn("Exception when closing the statement: " + e.getMessage());
}
try {
if (connection != null) {
@@ -275,7 +275,7 @@ public class JdbcClient {
}
} catch (SQLException e) {
error = true;
- logger.warn("Exception when closing the connection: " + e.getMessage());
+ LOG.warn("Exception when closing the connection: " + e.getMessage());
}
try {
if (this.statementHandler.preparedStatement != null) {
@@ -284,10 +284,10 @@ public class JdbcClient {
}
} catch (SQLException e) {
error = true;
- logger.warn("Exception when closing the prepared statement: " + e.getMessage());
+ LOG.warn("Exception when closing the prepared statement: " + e.getMessage());
}
if (!error) {
- logger.info("Shutdown all connections successfully.");
+ LOG.info("Shutdown all connections successfully.");
}
}
diff --git a/streampipes-extensions/streampipes-sinks-databases-jvm/src/main/java/org/apache/streampipes/sinks/databases/jvm/postgresql/PostgreSql.java b/streampipes-extensions/streampipes-sinks-databases-jvm/src/main/java/org/apache/streampipes/sinks/databases/jvm/postgresql/PostgreSql.java
index 268342d6d..dc4c1d4c7 100644
--- a/streampipes-extensions/streampipes-sinks-databases-jvm/src/main/java/org/apache/streampipes/sinks/databases/jvm/postgresql/PostgreSql.java
+++ b/streampipes-extensions/streampipes-sinks-databases-jvm/src/main/java/org/apache/streampipes/sinks/databases/jvm/postgresql/PostgreSql.java
@@ -19,22 +19,23 @@
package org.apache.streampipes.sinks.databases.jvm.postgresql;
import org.apache.streampipes.commons.exceptions.SpRuntimeException;
-import org.apache.streampipes.logging.api.Logger;
import org.apache.streampipes.model.runtime.Event;
import org.apache.streampipes.sinks.databases.jvm.jdbcclient.JdbcClient;
import org.apache.streampipes.sinks.databases.jvm.jdbcclient.model.SupportedDbEngines;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
public class PostgreSql extends JdbcClient {
- private PostgreSqlParameters params;
+ private static final Logger LOG = LoggerFactory.getLogger(PostgreSql.class);
- private Logger log;
+ private PostgreSqlParameters params;
public void onInvocation(PostgreSqlParameters parameters)
throws SpRuntimeException {
this.params = parameters;
- this.log = parameters.getGraph().getLogger(PostgreSql.class);
// get(0) because it is the only input stream of the sink (and not two)
// See (https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS)
@@ -42,8 +43,7 @@ public class PostgreSql extends JdbcClient {
initializeJdbc(
parameters.getGraph().getInputStreams().get(0).getEventSchema(),
parameters,
- SupportedDbEngines.POSTGRESQL,
- this.log);
+ SupportedDbEngines.POSTGRESQL);
}
@Override
@@ -61,9 +61,7 @@ public class PostgreSql extends JdbcClient {
try {
save(event);
} catch (SpRuntimeException e) {
- //TODO: error or warn?
- log.error(e.getMessage());
- //e.printStackTrace();
+ LOG.error(e.getMessage());
}
}
diff --git a/streampipes-logging/pom.xml b/streampipes-logging/pom.xml
deleted file mode 100644
index ace84d941..000000000
--- a/streampipes-logging/pom.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>streampipes-parent</artifactId>
- <groupId>org.apache.streampipes</groupId>
- <version>0.93.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
-
- <name>StreamPipes Logging</name>
- <artifactId>streampipes-logging</artifactId>
-
- <dependencies>
- <!-- External dependencies -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-checkstyle-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-</project>
\ No newline at end of file
diff --git a/streampipes-logging/src/main/java/org/apache/streampipes/logging/LoggerFactory.java b/streampipes-logging/src/main/java/org/apache/streampipes/logging/LoggerFactory.java
deleted file mode 100644
index 883ac39aa..000000000
--- a/streampipes-logging/src/main/java/org/apache/streampipes/logging/LoggerFactory.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.streampipes.logging;
-
-import org.apache.streampipes.logging.api.Logger;
-import org.apache.streampipes.logging.impl.PeLogger;
-
-public class LoggerFactory {
-
- // public static Logger getPeLogger(Class clazz, String correspondingPipeline, String peUri, PeConfig peConfig) {
- public static Logger getPeLogger(Class clazz, String correspondingPipeline, String peUri) {
- // return new PeLogger(clazz, correspondingPipeline, peUri, peConfig);
- return new PeLogger(clazz, correspondingPipeline, peUri);
- }
-}
diff --git a/streampipes-logging/src/main/java/org/apache/streampipes/logging/api/Logger.java b/streampipes-logging/src/main/java/org/apache/streampipes/logging/api/Logger.java
deleted file mode 100644
index c1ee5288b..000000000
--- a/streampipes-logging/src/main/java/org/apache/streampipes/logging/api/Logger.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.streampipes.logging.api;
-
-import java.io.Serializable;
-
-public interface Logger extends Serializable {
-
- void info(String s);
-
- void trace(String s);
-
- void debug(String s);
-
- void error(String s);
-
- void warn(String s);
-}
diff --git a/streampipes-logging/src/main/java/org/apache/streampipes/logging/impl/EventStatisticLogger.java b/streampipes-logging/src/main/java/org/apache/streampipes/logging/impl/EventStatisticLogger.java
deleted file mode 100644
index 559ce892a..000000000
--- a/streampipes-logging/src/main/java/org/apache/streampipes/logging/impl/EventStatisticLogger.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.streampipes.logging.impl;
-
-import java.io.Serializable;
-
-public class EventStatisticLogger implements Serializable {
-
-
- // private String prefix;
-
- // public static void log(org.apache.streampipes.model.base.InvocableStreamPipesEntity graph) {
- public static void log(String name, String correspondingPipeline, String source) {
- // TODO: Uncomment when "Event statistic" should be used
- /* String prefix = "SYSTEMLOG EVENT STATISTIC" + " - "
- // + "serviceName: " + peConfig.getName() + " - "
- + "correspondingPipeline: " + correspondingPipeline + " - "
- + "peURI: " + source + " - ";
-
- org.slf4j.Logger logger = LoggerFactory.getLogger(EventStatisticLogger.class);
- logger.info(prefix + 1);
- */
- }
-
-}
diff --git a/streampipes-logging/src/main/java/org/apache/streampipes/logging/impl/PeLogger.java b/streampipes-logging/src/main/java/org/apache/streampipes/logging/impl/PeLogger.java
deleted file mode 100644
index 392cc8edd..000000000
--- a/streampipes-logging/src/main/java/org/apache/streampipes/logging/impl/PeLogger.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.streampipes.logging.impl;
-
-import org.apache.streampipes.logging.api.Logger;
-
-import org.slf4j.LoggerFactory;
-
-public class PeLogger implements Logger {
-
- private org.slf4j.Logger logger;
-
- private String prefix;
-
-
- //public PeLogger(Class clazz, String correspondingPipeline, String peUri, PeConfig peConfig){
- public PeLogger(Class clazz, String correspondingPipeline, String peUri) {
- this.prefix = "USERLOG" + " - "
- // + "serviceName: " + peConfig.getName() + " - "
- + "correspondingPipeline: " + correspondingPipeline + " - "
- + "peURI: " + peUri + " - ";
-
- logger = LoggerFactory.getLogger(clazz);
- }
-
- public void info(String s) {
- logger.info(prefix + s);
- }
-
- public void trace(String s) {
- logger.trace(prefix + s);
- }
-
- public void debug(String s) {
- logger.debug(prefix + s);
- }
-
- public void error(String s) {
- logger.error(prefix + s);
- }
-
- public void warn(String s) {
- logger.warn(prefix + s);
- }
-
-}
diff --git a/streampipes-logging/src/main/java/org/apache/streampipes/logging/model/Log.java b/streampipes-logging/src/main/java/org/apache/streampipes/logging/model/Log.java
deleted file mode 100644
index d6d962d5b..000000000
--- a/streampipes-logging/src/main/java/org/apache/streampipes/logging/model/Log.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.streampipes.logging.model;
-
-public class Log {
-
- private String sourceID;
- private String timestamp;
- private String level;
- private String type;
- private String message;
-
-
- public String getsourceID() {
- return sourceID;
- }
-
- public void setsourceID(String sourceID) {
- this.sourceID = sourceID;
- }
-
- public String getTimestamp() {
- return timestamp;
- }
-
- public void setTimestamp(String timestamp) {
- this.timestamp = timestamp;
- }
-
- public String getLevel() {
- return level;
- }
-
- public void setLevel(String level) {
- this.level = level;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getMessage() {
- return message;
- }
-
- public void setMessage(String message) {
- this.message = message;
- }
-}
diff --git a/streampipes-logging/src/main/java/org/apache/streampipes/logging/model/LogRequest.java b/streampipes-logging/src/main/java/org/apache/streampipes/logging/model/LogRequest.java
deleted file mode 100644
index 66fd5803e..000000000
--- a/streampipes-logging/src/main/java/org/apache/streampipes/logging/model/LogRequest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.streampipes.logging.model;
-
-public class LogRequest {
-
- private String sourceID;
- private String dateFrom;
- private String dateTo;
-
- public String getSourceID() {
- return sourceID;
- }
-
- public void setSourceID(String source) {
- this.sourceID = source;
- }
-
- public String getDateFrom() {
- return dateFrom;
- }
-
- public void setDateFrom(String dateFrom) {
- this.dateFrom = dateFrom;
- }
-
- public String getDateTo() {
- return dateTo;
- }
-
- public void setDateTo(String dateTo) {
- this.dateTo = dateTo;
- }
-}
diff --git a/streampipes-model/pom.xml b/streampipes-model/pom.xml
index 1dec14801..c4d593d7e 100644
--- a/streampipes-model/pom.xml
+++ b/streampipes-model/pom.xml
@@ -37,11 +37,6 @@
<artifactId>streampipes-model-shared</artifactId>
<version>0.93.0-SNAPSHOT</version>
</dependency>
- <dependency>
- <groupId>org.apache.streampipes</groupId>
- <artifactId>streampipes-logging</artifactId>
- <version>0.93.0-SNAPSHOT</version>
- </dependency>
<dependency>
<groupId>org.apache.streampipes</groupId>
<artifactId>streampipes-vocabulary</artifactId>
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/base/InvocableStreamPipesEntity.java b/streampipes-model/src/main/java/org/apache/streampipes/model/base/InvocableStreamPipesEntity.java
index 0d64297fc..b43c37d4a 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/base/InvocableStreamPipesEntity.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/base/InvocableStreamPipesEntity.java
@@ -19,8 +19,6 @@
package org.apache.streampipes.model.base;
import org.apache.streampipes.commons.constants.InstanceIdExtractor;
-import org.apache.streampipes.logging.LoggerFactory;
-import org.apache.streampipes.logging.api.Logger;
import org.apache.streampipes.model.SpDataStream;
import org.apache.streampipes.model.api.EndpointSelectable;
import org.apache.streampipes.model.grounding.EventGrounding;
@@ -188,9 +186,4 @@ public abstract class InvocableStreamPipesEntity extends NamedStreamPipesEntity
return "/" + InstanceIdExtractor.extractId(getElementId());
}
- //public Logger getLogger(Class clazz, PeConfig peConfig) {
- public Logger getLogger(Class clazz) {
- //return LoggerFactory.getPeLogger(clazz, getCorrespondingPipeline(), getUri(), peConfig);
- return LoggerFactory.getPeLogger(clazz, getCorrespondingPipeline(), getUri());
- }
}
diff --git a/streampipes-service-discovery-consul/pom.xml b/streampipes-service-discovery-consul/pom.xml
index f6e34c39c..1558218ec 100644
--- a/streampipes-service-discovery-consul/pom.xml
+++ b/streampipes-service-discovery-consul/pom.xml
@@ -28,11 +28,6 @@
<artifactId>streampipes-service-discovery-consul</artifactId>
<dependencies>
- <dependency>
- <groupId>org.apache.streampipes</groupId>
- <artifactId>streampipes-logging</artifactId>
- <version>0.93.0-SNAPSHOT</version>
- </dependency>
<dependency>
<groupId>org.apache.streampipes</groupId>
<artifactId>streampipes-serializers-json</artifactId>
diff --git a/streampipes-wrapper-kafka-streams/src/main/java/org/apache/streampipes/wrapper/kafka/converter/JsonToMapFormat.java b/streampipes-wrapper-kafka-streams/src/main/java/org/apache/streampipes/wrapper/kafka/converter/JsonToMapFormat.java
index 9a077d313..390dc65e4 100644
--- a/streampipes-wrapper-kafka-streams/src/main/java/org/apache/streampipes/wrapper/kafka/converter/JsonToMapFormat.java
+++ b/streampipes-wrapper-kafka-streams/src/main/java/org/apache/streampipes/wrapper/kafka/converter/JsonToMapFormat.java
@@ -17,7 +17,6 @@
*/
package org.apache.streampipes.wrapper.kafka.converter;
-import org.apache.streampipes.logging.impl.EventStatisticLogger;
import org.apache.streampipes.model.base.InvocableStreamPipesEntity;
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -43,7 +42,6 @@ public class JsonToMapFormat implements ValueMapper<String, Iterable<Map<String,
@Override
public Iterable<Map<String, Object>> apply(String s) {
try {
- EventStatisticLogger.log(graph.getName(), graph.getCorrespondingPipeline(), graph.getUri());
return Arrays.asList(mapper.readValue(s, HashMap.class));
} catch (IOException e) {
e.printStackTrace();