Bug #2920
closedOn tests, logger try to write to /var/log/rudder/core/
Description
When tests are executed, the "OPSLOG" logger try to write "/var/log/rudder/core/rudder-webapp.log".
It should be "/tmp/rudder-test-logs/rudder-webapp.log"
=> create a logback-test.xml correctly configured
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.normation.rudder.web.services.Section2FieldServiceTest
10:26:19,744 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
10:26:19,744 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
10:26:19,744 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/var/lib/jenkins/jobs/Rudder-2.4-branch/workspace/rudder-web/target/classes/logback.xml]
10:26:21,401 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
10:26:21,528 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
10:26:21,531 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
10:26:21,956 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.FileAppender]
10:26:21,957 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [OPSLOG]
10:26:21,958 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
10:26:21,959 |-INFO in ch.qos.logback.core.FileAppender[OPSLOG] - File property is set to [/var/log/rudder/core/rudder-webapp.log]
10:26:21,969 |-ERROR in ch.qos.logback.core.FileAppender[OPSLOG] - Failed to create parent directories for [/var/log/rudder/core/rudder-webapp.log]
10:26:21,969 |-ERROR in ch.qos.logback.core.FileAppender[OPSLOG] - openFile(/var/log/rudder/core/rudder-webapp.log,true) call failed. java.io.FileNotFoundException: /var/log/rudder/core/rudder-webapp.log (No such file or directory)
at java.io.FileNotFoundException: /var/log/rudder/core/rudder-webapp.log (No such file or directory)
Updated by François ARMAND over 12 years ago
- Status changed from 2 to Pending technical review
- % Done changed from 0 to 100
Applied in changeset 05d911f60a18f2b3a36b93a2adeba845e3ae548c.
Updated by Jonathan CLARKE over 12 years ago
- Status changed from Pending technical review to Discussion
According to the logback documentation at http://logback.qos.ch/manual/configuration.html, the logback-test.xml file can advantageously be place under src/test/resources, and not src/main/resources as we have it:
If you are using Maven and if you place the logback-test.xml under the src/test/resources folder, Maven will ensure that it won't be included in the artifact produced. Thus, you can use a different configuration file, namely logback-test.xml during testing, and another file, namely, logback.xml, in production. The same principle applies by analogy for Ant.
Why not do this here?
Aside from this, the commit looks fine.
Updated by François ARMAND over 12 years ago
Ah, right, that's an error :/
It should be in src/test/ressource.
Updated by François ARMAND over 12 years ago
- Status changed from Discussion to Pending technical review
Applied in changeset b7d79d0e9feaa63e5e9a07d719d5bf1eed411ebe.
Updated by Jonathan CLARKE over 12 years ago
- Status changed from Pending technical review to Released
Looks good to me. Thanks François!
Updated by Nicolas PERRON almost 12 years ago
- Project changed from Rudder to 34
- Category deleted (
11)
Updated by Jonathan CLARKE almost 12 years ago
- Project changed from 34 to Rudder
Updated by Benoît PECCATTE almost 10 years ago
- Category changed from 40 to Architecture - Code maintenance