summaryrefslogtreecommitdiffstats
path: root/java/vaadin/src/main/resources
diff options
context:
space:
mode:
Diffstat (limited to 'java/vaadin/src/main/resources')
-rw-r--r--java/vaadin/src/main/resources/Application.properties2
-rw-r--r--java/vaadin/src/main/resources/logback-test.xml48
2 files changed, 50 insertions, 0 deletions
diff --git a/java/vaadin/src/main/resources/Application.properties b/java/vaadin/src/main/resources/Application.properties
index 193ca7f..512362b 100644
--- a/java/vaadin/src/main/resources/Application.properties
+++ b/java/vaadin/src/main/resources/Application.properties
@@ -1,3 +1,5 @@
app.name=VaadinHelloWorld
app.version=0.0.1
app.path=/hello
+app.env=DEV
+app.logfile=/var/log/tomcat7/HelloWorld.log
diff --git a/java/vaadin/src/main/resources/logback-test.xml b/java/vaadin/src/main/resources/logback-test.xml
new file mode 100644
index 0000000..4c53061
--- /dev/null
+++ b/java/vaadin/src/main/resources/logback-test.xml
@@ -0,0 +1,48 @@
+<configuration debug="true">
+
+ <contextName>HelloWorld</contextName>
+ <property resource="Application.properties" />
+ <property name="LOG_LEVEL" value="INFO" />
+ <property name="LOG_REF" value="FILE" />
+ <property name="LOG_FILE" value="${app.logfile}" />
+ <property name="LOG_PATTERN" value="%contextName %date{ISO8601} [%-5level %thread] [%file:%line] - %msg%n" />
+
+ <if condition='property("app.env").contains("DEV")'>
+ <then>
+ <property name="LOG_LEVEL" value="DEBUG" />
+ </then>
+ </if>
+
+ <if condition='isDefined("TEST_DB")'>
+ <then>
+ <property name="LOG_LEVEL" value="DEBUG" />
+ <property name="LOG_REF" value="FILE" />
+ <property name="LOG_FILE" value="./tests/logs" />
+ </then>
+ </if>
+
+ <if condition='isDefined("TEST_PDF")'>
+ <then>
+ <property name="LOG_LEVEL" value="DEBUG" />
+ <property name="LOG_REF" value="STDOUT" />
+ </then>
+ </if>
+
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>${LOG_PATTERN}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="FILE" class="ch.qos.logback.core.FileAppender">
+ <file>${LOG_FILE}</file>
+ <encoder>
+ <pattern>${LOG_PATTERN}</pattern>
+ </encoder>
+ </appender>
+
+ <root level="${LOG_LEVEL}">
+ <appender-ref ref="${LOG_REF}" />
+ </root>
+
+</configuration>