You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by cocorossello <co...@gmail.com> on 2016/04/17 12:40:46 UTC

Arquillian tomee-embedded and logback

Hi,

We have tomee with logback, which is great. The problem is that I'm not able
to use logback in an arquillian test with tomee-embedded. The tomee output
seems to be using log4j for some reason. Logback/slf4j dependencies are in
classpath and logback.xml is provided

Did someone solve it?



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Arquillian-tomee-embedded-and-logback-tp4678165.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Arquillian tomee-embedded and logback

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

You will likely need to exclude other slf4j impl/bindings like jdk14 one
coming with tomee embedded. Adding logback AND slf4j api in the archive can
work too for app logging but not container
Le 17 avr. 2016 13:13, "cocorossello" <co...@gmail.com> a écrit :

> Hi,
>
> We have tomee with logback, which is great. The problem is that I'm not
> able
> to use logback in an arquillian test with tomee-embedded. The tomee output
> seems to be using log4j for some reason. Logback/slf4j dependencies are in
> classpath and logback.xml is provided
>
> Did someone solve it?
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/Arquillian-tomee-embedded-and-logback-tp4678165.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: Arquillian tomee-embedded and logback

Posted by cocorossello <co...@gmail.com>.
Got it, I just had to set the system property in the maven surefire plugin

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <systemProperties>
                          <property> 
                            <name>java.util.logging.config.file</name>
                           
<value>src/test/resources/logging.properties</value>
                          </property>
                        </systemProperties>   
...

Thanks



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Arquillian-tomee-embedded-and-logback-tp4678165p4678168.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Arquillian tomee-embedded and logback

Posted by Steve Goldsmith <sg...@gmail.com>.
Here's what I use for TomEE embedded:

            <!-- Use tomee:run to launch TomEE and leave running -->
            <plugin>
                <groupId>org.apache.tomee.maven</groupId>
                <artifactId>tomee-maven-plugin</artifactId>
                <version>${tomee.version}</version>
                <configuration>
                    <tomeeVersion>${tomee.version}</tomeeVersion>
                    <tomeeClassifier>plus</tomeeClassifier>
                    <zip>false</zip>
                    <classpaths>

<classpath>${project.build.directory}/apache-tomee/conf/logback-config</classpath>

<classpath>${project.build.directory}/apache-tomee/lib/slf4j-api-${slf4j.version}.jar</classpath>

<classpath>${project.build.directory}/apache-tomee/lib/logback-core-${logback.version}.jar</classpath>

<classpath>${project.build.directory}/apache-tomee/lib/logback-classic-${logback.version}.jar</classpath>
                    </classpaths>
                    <systemVariables>
                        <file.encoding>UTF-8</file.encoding>
                        <openejb.log.factory>slf4j</openejb.log.factory>

<logback.configurationFile>${project.basedir}/src/main/resources/logback.xml</logback.configurationFile>
                    </systemVariables>
                    <libs>
                        <!-- logging -->
                        <lib>org.slf4j:slf4j-api:${slf4j.version}</lib>

<lib>ch.qos.logback:logback-classic:${logback.version}</lib>

<lib>ch.qos.logback:logback-core:${logback.version}</lib>
                        <!-- remove unused -->
                        <lib>remove:slf4j-jdk14</lib>
                        <lib>remove:slf4j-api-1.7.2</lib>
                    </libs>
                    <reloadOnUpdate>true</reloadOnUpdate>
                    <synchronization>
                        <extensions>
                            <extension>.class</extension>
                        </extensions>
                        <updateOnlyExtensions>

<updateOnlyExtension>.xhtml</updateOnlyExtension>
                            <updateOnlyExtension>.html</updateOnlyExtension>
                            <updateOnlyExtension>.js</updateOnlyExtension>
                            <updateOnlyExtension>.css</updateOnlyExtension>
                        </updateOnlyExtensions>
                    </synchronization>
                </configuration>
            </plugin>
            <!-- TomEE embedded -->
            <plugin>
                <groupId>org.apache.tomee.maven</groupId>
                <artifactId>tomee-embedded-maven-plugin</artifactId>
                <version>${tomee.version}</version>
            </plugin>
...

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${logback.version}</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-core</artifactId>
            <version>${logback.version}</version>
        </dependency>



On Sun, Apr 17, 2016 at 6:40 AM, cocorossello <co...@gmail.com>
wrote:

> Hi,
>
> We have tomee with logback, which is great. The problem is that I'm not
> able
> to use logback in an arquillian test with tomee-embedded. The tomee output
> seems to be using log4j for some reason. Logback/slf4j dependencies are in
> classpath and logback.xml is provided
>
> Did someone solve it?
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/Arquillian-tomee-embedded-and-logback-tp4678165.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>



-- 
Steven P. Goldsmith