>>>>> Steinar Bang <[email protected]>:
>> Does anyone know how to get the karaf.log output from pax exam tests
>> using the karaf container?
[snip!]
> Then it says that pax exam provisions pax logging to the test container.
> Is that where the problem is perhaps? The Karaf container also
> provisions pax logging overriding the one from pax exam but karaf's
> logging just disappears into nothing?
Something like the latter, I think...? Stuff running inside karaf gets
the logging service provisioned by karaf, and this logging service needs
to be configured...?
I got a pointer for how to configure karaf logging in pax exam, on the
karaf users mailing list[1].
Here's what I did, following the instructions in [1]:
1. Copied the getConfigFile() method from the KarafTestSupport.java
file into my pax exam test
https://github.com/apache/karaf/blob/master/itests/src/test/java/org/apache/karaf/itests/KarafTestSupport.java#L174
2. Copied the "replaceConfigureFile" setting from KarafTestSupport into
the configuration options of my pax exam test:
https://github.com/apache/karaf/blob/master/itests/src/test/java/org/apache/karaf/itests/KarafTestSupport.java#L201
3. Copied the config file from the karaf test into
src/test/resources/etc in my pax exam project
https://github.com/apache/karaf/blob/master/itests/src/test/resources/etc/org.ops4j.pax.logging.cfg
4. Add keepRuntimeFolder() to the configuration options:
https://github.com/apache/karaf/blob/master/itests/src/test/java/org/apache/karaf/itests/KarafTestSupport.java#L197
Then the resulting karaf.log file ended up as
target/exam/<uuid>/data/log/karaf.log
Note that if keepRuntimeFolder() isn't set, the runtime is cleaned up at
the end of the test, and karaf.log is gone.
References:
[1]
<http://karaf.922171.n3.nabble.com/How-to-get-the-karaf-log-logging-in-a-pax-exam-test-with-the-karaf-container-tp4050941p4050944.html>
--
--
------------------
OPS4J - http://www.ops4j.org - [email protected]
---
You received this message because you are subscribed to the Google Groups
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.