This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit 38e99ad8d27d89c31fb1cb17ce09041d2d353dc8 Author: Andrea Cosentino <[email protected]> AuthorDate: Thu Nov 3 14:13:56 2022 +0100 Camel-Plc4x: Better logging configuration for testing Signed-off-by: Andrea Cosentino <[email protected]> --- components/camel-plc4x/pom.xml | 5 +++++ .../org/apache/camel/component/plc4x/plc4x.json | 4 ++-- .../camel-plc4x/src/test/resources/log4j2.properties | 17 +++++++++++------ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/components/camel-plc4x/pom.xml b/components/camel-plc4x/pom.xml index f315457fce5..7f6ac68fe25 100644 --- a/components/camel-plc4x/pom.xml +++ b/components/camel-plc4x/pom.xml @@ -158,6 +158,11 @@ <artifactId>hamcrest</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-slf4j-impl</artifactId> + <scope>test</scope> + </dependency> <dependency> <!-- avoids java.lang.NoClassDefFoundError: javax/activation/DataHandler in Plc4XProducerTest on Java 11--> <groupId>javax.activation</groupId> diff --git a/components/camel-plc4x/src/generated/resources/org/apache/camel/component/plc4x/plc4x.json b/components/camel-plc4x/src/generated/resources/org/apache/camel/component/plc4x/plc4x.json index d9a0becce30..67c4e12624b 100644 --- a/components/camel-plc4x/src/generated/resources/org/apache/camel/component/plc4x/plc4x.json +++ b/components/camel-plc4x/src/generated/resources/org/apache/camel/component/plc4x/plc4x.json @@ -28,9 +28,9 @@ }, "properties": { "driver": { "kind": "path", "displayName": "Driver", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "PLC4X connection string for the connection to the target" }, - "period": { "kind": "parameter", "displayName": "Period", "group": "common", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "(Consumer) Interval on which the Trigger should be checked" }, "tags": { "kind": "parameter", "displayName": "Tags", "group": "common", "label": "", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The tags to read as Map containing the tag name associated to its query" }, - "trigger": { "kind": "parameter", "displayName": "Trigger", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "(Consumer) Query to a trigger. On a rising edge of the trigger, the tags will be read once" }, + "period": { "kind": "parameter", "displayName": "Period", "group": "consumer", "label": "consumer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Interval on which the Trigger should be checked" }, + "trigger": { "kind": "parameter", "displayName": "Trigger", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Query to a trigger. On a rising edge of the trigger, the tags will be read once" }, "bridgeErrorHandler": { "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now [...] "exceptionHandler": { "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the con [...] "exchangePattern": { "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut", "InOptionalOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." }, diff --git a/components/camel-plc4x/src/test/resources/log4j2.properties b/components/camel-plc4x/src/test/resources/log4j2.properties index 114baa6aab1..a409c5d4e7e 100644 --- a/components/camel-plc4x/src/test/resources/log4j2.properties +++ b/components/camel-plc4x/src/test/resources/log4j2.properties @@ -14,9 +14,14 @@ # See the License for the specific language governing permissions and # limitations under the License. # -appender.out.type=Console -appender.out.name=out -appender.out.layout.type=PatternLayout -appender.out.layout.pattern=[%30.30t] %-30.30c{1} %-5p %m%n -rootLogger.level=INFO -rootLogger.appenderRef.out.ref=out +appender.file.type = File +appender.file.name = file +appender.file.fileName = target/camel-plc4x-test.log +appender.file.layout.type = PatternLayout +appender.file.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n +appender.out.type = Console +appender.out.name = out +appender.out.layout.type = PatternLayout +appender.out.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n +rootLogger.level = INFO +rootLogger.appenderRef.file.ref = file
