You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Marco Bungart (Jira)" <ji...@apache.org> on 2023/01/13 14:29:00 UTC

[jira] [Updated] (CAMEL-18916) camel-xslt-saxon: allow logger injection

     [ https://issues.apache.org/jira/browse/CAMEL-18916?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marco Bungart updated CAMEL-18916:
----------------------------------
    Priority: Minor  (was: Major)

> camel-xslt-saxon: allow logger injection
> ----------------------------------------
>
>                 Key: CAMEL-18916
>                 URL: https://issues.apache.org/jira/browse/CAMEL-18916
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-xslt
>    Affects Versions: 3.18.2, 3.18.3, 3.18.4, 3.19.0
>            Reporter: Marco Bungart
>            Priority: Minor
>
> Currently, when we use {{camel-xslt-saxon}} in combination with {{<xsl:message ... />}}, the message will be written directly to {{System.out}}. This is not desired when the application, for example, uses json logging. It would be nice to have the capability to inject a logger-instance (e.g. {{org.slf4j.Logger}} or {{org.apache.logging.log4j.Logger}}) and redirect the log-output to that logger-instance.
> ---
> Reproducer:
> - checkout {{https://github.com/turing85/quarkus-camel-xslt-logging.git}}
> - run the test: {{./mvnw clean test}}
> - observe that the message produced by {{<xsl:message select = "'Creating response for name = ', $name"/>}} in {{src/main/resources/Transformer.xsl}} is logged unformatted:
> {{...}}
> {{2023-01-13 15:18:24,324 INFO  [org.apa.cam.con.jax.StaxConverter] (executor-thread-0) Created XMLInputFactory: com.sun.xml.internal.stream.XMLInputFactoryImpl@38874bd. DOMSource/DOMResult may have issues with com.sun.xml.internal.stream.XMLInputFactoryImpl@38874bd. We suggest using Woodstox.}}
> {{Creating response for name = John Doe}}
> {{[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 7.232 s - in de.turing85.quarkus.camel.xslt.RouteTest}}
> {{...}}
> ---
> Current Behaviour:
> Log message is directly written to {{System.out}} and therefore not formatted.
> ---
> Desired behaviour:
> The message is delegated to the logger-instance, and is therefore formatted by the logger-instance.
> ---
> Environment:
> - Java compiler used: {{openjdk 19.0.1 2022-10-18}}
> - Quarkus version: {{2.15.3}}
> - Quarkus-camel version: {{2.15.3}}
> - Camel version: {{3.19.0}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)