Project

General

Profile

Actions

Bug #2920

closed

On tests, logger try to write to /var/log/rudder/core/

Added by François ARMAND about 12 years ago. Updated over 9 years ago.

Status:
Released
Priority:
2
Category:
Architecture - Code maintenance
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

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)

Actions #1

Updated by François ARMAND about 12 years ago

  • Status changed from 2 to Pending technical review
  • % Done changed from 0 to 100
Actions #2

Updated by Jonathan CLARKE about 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.

Actions #3

Updated by François ARMAND about 12 years ago

Ah, right, that's an error :/
It should be in src/test/ressource.

Actions #4

Updated by François ARMAND about 12 years ago

  • Status changed from Discussion to Pending technical review
Actions #5

Updated by Jonathan CLARKE about 12 years ago

  • Status changed from Pending technical review to Released

Looks good to me. Thanks François!

Actions #6

Updated by Nicolas PERRON almost 12 years ago

  • Project changed from Rudder to 34
  • Category deleted (11)
Actions #7

Updated by Jonathan CLARKE almost 12 years ago

  • Project changed from 34 to Rudder
Actions #8

Updated by Jonathan CLARKE almost 12 years ago

  • Category set to 40
Actions #9

Updated by Benoît PECCATTE over 9 years ago

  • Category changed from 40 to Architecture - Code maintenance
Actions

Also available in: Atom PDF