-
Notifications
You must be signed in to change notification settings - Fork 142
set loglevel to scr #420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
set loglevel to scr #420
Conversation
Signed-off-by: Stefan Bischof <[email protected]>
i am struggeling. Someon knows hot to remove this from the log? @oliverlietz
|
Sadly not, I have had the same problem here: |
@stbischof In my own projects where I use Pax Exam, I have set the log-level of 'shaded.org.apache.http' to WARN to avoid any downloads initiated from Pax Exam, to have the contents of these downloads (ie the bytes) be logged. |
Sounds good. But how. I never used pax. Could you help me with this pr? And update the code or paste the lines andnpositions |
I don't know how logging is configured within the SCR project's test suite, but I can have a look later tonight. |
@stbischof I have made some progress, but along the way found that there is some what I would consider technical debt related to logging and its configuration. I found that this project refers to both pax-logging-api/pax-logging-service (which embeds various logging APIs (among others, SLF4j) and log4j), and it refers to logback. As pax-logging version used is quite old, the versions it embeds are also quite old, whilst the logback reference (1.3.13/1.3.15) is quite a bit more recent. This logback version is already dependent on SLF4j 2.x for instance, whilst the pax logging's highest SFL4j version is 1.6. Also it should be noted that Pax Exam is used with the forked factory, meaning that the OSGi runtime it builds is executed in a separate process, from JUnit in which Pax Exam constructs this runtime. It is in the JUnit process where any dependencies are downloaded (and where the bytes dump towards the log originates from). With the following steps I got a bit control on what happens, but this imo is still not a clean solution:
<configuration>
<!-- defined a console append -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%15.15thread] %-5level %-36.36logger{36} - %msg%n</pattern>
</encoder>
</appender>
<logger name="shaded.org.apache.http" level="WARN" />
<root level="DEBUG">
<appender-ref ref="STDOUT" />
</root>
</configuration> |
Could you create. Pr of this? Or a fix hat makes it in a more modern way? |
@grgrzybek can you help here with felix usage of pax-exam? Maybe we should just upgrade to a more recent version... |
…nges disables Pax Exam's preference for Pax Logging, and changes it with Logback (in the latest SLF4j 1.7.x compatible version). With this change, SLF4j and Logback are now available for both the unit tests and the pax exam tests. Configured explicit versions of all 'mavenBundle's declared in the ComponentTestBase, as otherwise Pax will depend on Maven's LATEST, which is not always compatible.
I have just created #421 , could you have a look at it? |
…isables Pax Exam's preference for Pax Logging, and changes it with Logback (in the latest SLF4j 1.7.x compatible version). With this change, SLF4j and Logback are now available for both the unit tests and the pax exam tests. Configured explicit versions of all 'mavenBundle's declared in the ComponentTestBase, as otherwise Pax will depend on Maven's LATEST, which is not always compatible.
No description provided.