Skip to content

Commit

Permalink
use src/main/resources folder for xml and properties files
Browse files Browse the repository at this point in the history
  • Loading branch information
ceki committed Mar 27, 2016
1 parent 6d57080 commit ef579e7
Show file tree
Hide file tree
Showing 93 changed files with 236 additions and 96 deletions.
10 changes: 5 additions & 5 deletions logback-examples/src/main/resources/chapters/appenders/conf/logback-sizeAndTime.xml 100644 → 100755
Expand Up @@ -4,13 +4,13 @@

<appender name="ROLLING" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>mylog.txt</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!-- rollover daily -->
<fileNamePattern>mylog-%d{yyyy-MM-dd}.%i.txt</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 100MB -->
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!-- each file should be at most 100MB, keep 60 days worth of history, but at most 20GB -->
<maxFileSize>100MB</maxFileSize>
<maxHistory>60</maxHistory>
<totalSizeCap>20GB</totalSizeCap>
</rollingPolicy>
<encoder>
<pattern>%msg%n</pattern>
Expand Down
@@ -0,0 +1,24 @@
<configuration>

<statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" />

<appender name="ROLLING" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>mylog.txt</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!-- rollover daily -->
<fileNamePattern>mylog-%d{yyyy-MM-dd'T'HHmmss}.%i.txt</fileNamePattern>
<maxFileSize>100</maxFileSize>
<maxHistory>2</maxHistory>
<totalSizeCap>200</totalSizeCap>
</rollingPolicy>
<encoder>
<pattern>%msg%n</pattern>
</encoder>
</appender>


<root level="debug">
<appender-ref ref="ROLLING" />
</root>

</configuration>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,7 @@
This directory contains the the calculator example. It shows how Actions can
collaborate in order to accomplish a simple computation.

For further information, please refer to

http://logback.qos.ch/manual/onJoran.html#calculator

File renamed without changes.
@@ -0,0 +1,6 @@
The example illustrates the minimal plumbing required for using Joran.

For further explanations, please refer to

http://logback.qos.ch/manual/onJoran.html#helloWorld

File renamed without changes.
@@ -0,0 +1,7 @@

This directory contains an example illustrating implicit actions.

For further information, please refer to

http://logback.qos.ch/manual/onJoran.html#implicit

File renamed without changes.
@@ -0,0 +1,8 @@

This directory contains an example showing how Joran can
learn new parsing rules on the fly.

For further documentation please see

http://logback.qos.ch/manual/onJoran.html#newRule

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
172 changes: 123 additions & 49 deletions logback-site/src/site/pages/manual/appenders.html

Large diffs are not rendered by default.

46 changes: 23 additions & 23 deletions logback-site/src/site/pages/manual/configuration.html
Expand Up @@ -258,7 +258,7 @@ <h3>Automatic configuration with <em>logback-test.xml</em> or
</p>

<p class="example">Example: Basic configuration file
(logback-examples/src/main/java/chapters/configuration/sample0.xml)</p>
(logback-examples/src/main/resources/chapters/configuration/sample0.xml)</p>
<span class="asGroovy" onclick="return asGroovy('sample0');">View as .groovy</span>


Expand Down Expand Up @@ -353,7 +353,7 @@ <h4 class="doAnchor" name="automaticStatusPrinting">Automatic

<p class="example">Example: Basic configuration file using debug
mode
(logback-examples/src/main/java/chapters/configuration/sample1.xml)</p>
(logback-examples/src/main/resources/chapters/configuration/sample1.xml)</p>
<span class="asGroovy" onclick="return asGroovy('sample1');">View as .groovy</span>

<pre id="sample1" class="prettyprint source">
Expand Down Expand Up @@ -445,7 +445,7 @@ <h3 class="doAnchor" name="autoScan">Automatically reloading

<p class="example">Example: Scanning for changes in configuration
file and automatic re-configuration
(logback-examples/src/main/java/chapters/configuration/scan1.xml)</p>
(logback-examples/src/main/resources/chapters/configuration/scan1.xml)</p>

<span class="asGroovy" onclick="return asGroovy('scan1');">View as .groovy</span>
<pre id="scan1" class="prettyprint source">
Expand All @@ -462,7 +462,7 @@ <h3 class="doAnchor" name="autoScan">Automatically reloading
example:</p>

<p class="example">Example: Specifying a different scanning period
(logback-examples/src/main/java/chapters/configuration/scan2.xml)</p>
(logback-examples/src/main/resources/chapters/configuration/scan2.xml)</p>
<span class="asGroovy" onclick="return asGroovy('scan2');">View as .groovy</span>
<pre id="scan2" class="prettyprint source">
&lt;configuration scan="true" <b>scanPeriod="30 seconds"</b> >
Expand Down Expand Up @@ -708,7 +708,7 @@ <h3 class="doAnchor" name="statusListener">Listening to status
within a configuration file. Here is an example.</p>

<p class="example">Example: Registering a status listener
(logback-examples/src/main/java/chapters/configuration/onConsoleStatusListener.xml)</p>
(logback-examples/src/main/resources/chapters/configuration/onConsoleStatusListener.xml)</p>

<span class="asGroovy" onclick="return asGroovy('onConsoleStatusListener');">View as .groovy</span>
<pre id="onConsoleStatusListener" class="prettyprint source">&lt;configuration>
Expand Down Expand Up @@ -933,7 +933,7 @@ <h4>Example</h4>
</p>

<p class="example">Example: Setting the level of a logger
(logback-examples/src/main/java/chapters/configuration/sample2.xml)</p>
(logback-examples/src/main/resources/chapters/configuration/sample2.xml)</p>

<span class="asGroovy" onclick="return asGroovy('sample2');">View as .groovy</span>
<pre id="sample2" class="prettyprint source">&lt;configuration>
Expand Down Expand Up @@ -974,7 +974,7 @@ <h4>Example</h4>
</p>

<p class="example">Example: Setting the level of multiple loggers
(logback-examples/src/main/java/chapters/configuration/sample3.xml)</p>
(logback-examples/src/main/resources/chapters/configuration/sample3.xml)</p>

<span class="asGroovy" onclick="return asGroovy('sample3');">View as .groovy</span>
<pre id="sample3" class="source prettyprint">&lt;configuration>
Expand Down Expand Up @@ -1056,7 +1056,7 @@ <h4>Example</h4>
</p>

<p class="example">Example: Logger level sample
(logback-examples/src/main/java/chapters/configuration/sample4.xml)</p>
(logback-examples/src/main/resources/chapters/configuration/sample4.xml)</p>
<span class="asGroovy" onclick="return asGroovy('sample4');">View as .groovy</span>
<pre id="sample4" class="prettyprint source">&lt;configuration>

Expand Down Expand Up @@ -1181,7 +1181,7 @@ <h4 class="doAnchor" name="configuringAppenders">Configuring
</p>

<p class="example">Example: Multiple loggers
(logback-examples/src/main/java/chapters/configuration/multiple.xml)</p>
(logback-examples/src/main/resources/chapters/configuration/multiple.xml)</p>

<span class="asGroovy" onclick="return asGroovy('multiple');">View as .groovy</span>
<pre id="multiple" class="prettyprint source">&lt;configuration>
Expand Down Expand Up @@ -1236,7 +1236,7 @@ <h4 class="doAnchor" name="cumulative">Appenders accumulate
</p>

<p class="example">Example: Duplicate appender
(logback-examples/src/main/java/chapters/configuration/duplicate.xml)</p>
(logback-examples/src/main/resources/chapters/configuration/duplicate.xml)</p>

<span class="asGroovy" onclick="return asGroovy('duplicate');">View as .groovy</span>
<pre id="duplicate" class="prettyprint source">&lt;configuration>
Expand Down Expand Up @@ -1286,7 +1286,7 @@ <h4 class="doAnchor" name="cumulative">Appenders accumulate
</p>

<p class="example">Example: Multiple appender
(logback-examples/src/main/java/chapters/configuration/restricted.xml)</p>
(logback-examples/src/main/resources/chapters/configuration/restricted.xml)</p>
<span class="asGroovy" onclick="return asGroovy('restricted');">View as .groovy</span>
<pre id="restricted" class="prettyprint source">&lt;configuration>

Expand Down Expand Up @@ -1329,7 +1329,7 @@ <h4 class="doAnchor" name="overrridingCumulativity">Overriding the
</p>

<p class="example">Example: Additivity flag
(logback-examples/src/main/java/chapters/configuration/additivityFlag.xml)</p>
(logback-examples/src/main/resources/chapters/configuration/additivityFlag.xml)</p>

<span class="asGroovy" onclick="return asGroovy('additivityFlag');">View as .groovy</span>
<pre id="additivityFlag" class="prettyprint source">&lt;configuration>
Expand Down Expand Up @@ -1385,7 +1385,7 @@ <h3 class="doAnchor" name="contextName">Setting the context
</p>

<p class="example">Example: Set the context name and display it
(logback-examples/src/main/java/chapters/configuration/contextName.xml)</p>
(logback-examples/src/main/resources/chapters/configuration/contextName.xml)</p>

<span class="asGroovy" onclick="return asGroovy('contextName');">View as .groovy</span>
<pre id="contextName" class="prettyprint source">&lt;configuration>
Expand Down Expand Up @@ -1456,7 +1456,7 @@ <h4 class="doAnchor" name="definingProps">Defining variables</h4>
</p>

<p class="example">Example: Simple Variable substitution
(logback-examples/src/main/java/chapters/configuration/variableSubstitution1.xml)
(logback-examples/src/main/resources/chapters/configuration/variableSubstitution1.xml)
</p>

<span class="asGroovy" onclick="return asGroovy('variableSubstitution1');">View as .groovy</span>
Expand Down Expand Up @@ -1485,7 +1485,7 @@ <h4 class="doAnchor" name="definingProps">Defining variables</h4>
<p class="source">java -DUSER_HOME="/home/sebastien" MyApp2</p>

<p class="example">Example: System Variable substitution
(logback-examples/src/main/java/chapters/configuration/variableSubstitution2.xml)
(logback-examples/src/main/resources/chapters/configuration/variableSubstitution2.xml)
</p>
<span class="asGroovy" onclick="return asGroovy('variableSubstitution2');">View as .groovy</span>
<pre id="variableSubstitution2" class="prettyprint source">&lt;configuration>
Expand All @@ -1510,7 +1510,7 @@ <h4 class="doAnchor" name="definingProps">Defining variables</h4>

<p class="example">Example: Variable substitution using a
separate file
(logback-examples/src/main/java/chapters/configuration/variableSubstitution3.xml)
(logback-examples/src/main/resources/chapters/configuration/variableSubstitution3.xml)
</p>
<span class="asGroovy" onclick="return asGroovy('variableSubstitution3');">View as .groovy</span>
<pre id="variableSubstitution3" class="prettyprint source">&lt;configuration>
Expand All @@ -1536,7 +1536,7 @@ <h4 class="doAnchor" name="definingProps">Defining variables</h4>
</p>

<em>Example: Variable file
(logback-examples/src/main/java/chapters/configuration/variables1.properties)</em>
(logback-examples/src/main/resources/chapters/configuration/variables1.properties)</em>

<pre class="source">USER_HOME=/home/sebastien</pre>

Expand Down Expand Up @@ -1610,7 +1610,7 @@ <h4 class="doAnchor" name="scopes">Scopes</h4>
</p>

<p class="example">Example: A variable defined in "context" scope
(logback-examples/src/main/java/chapters/configuration/contextScopedVariable.xml)
(logback-examples/src/main/resources/chapters/configuration/contextScopedVariable.xml)
</p>

<span class="asGroovy" onclick="return
Expand Down Expand Up @@ -1664,7 +1664,7 @@ <h4>value nesting</h4>
</p>

<p class="example">Example: Nested variable references
(logback-examples/src/main/java/chapters/configuration/variables2.properties)</p>
(logback-examples/src/main/resources/chapters/configuration/variables2.properties)</p>

<pre class="source">USER_HOME=/home/sebastien
fileName=myApp.log
Expand All @@ -1677,7 +1677,7 @@ <h4>value nesting</h4>

<em>Example: Variable substitution using
a separate file
(logback-examples/src/main/java/chapters/configuration/variableSubstitution4.xml)</em>
(logback-examples/src/main/resources/chapters/configuration/variableSubstitution4.xml)</em>

<pre class="prettyprint source">&lt;configuration>

Expand Down Expand Up @@ -1913,7 +1913,7 @@ <h3 class="doAnchor" name="insertFromJNDI">Obtaining variables from

<p class="example">Example: Insert as properties env-entries
obtained via JNDI
(logback-examples/src/main/java/chapters/configuration/insertFromJNDI.xml)</p>
(logback-examples/src/main/resources/chapters/configuration/insertFromJNDI.xml)</p>

<pre class="prettyprint source">&lt;configuration>
<b>&lt;insertFromJNDI env-entry-name="java:comp/env/appName" as="<span class="green">appName"</span> /></b>
Expand Down Expand Up @@ -1946,7 +1946,7 @@ <h3 class="doAnchor" name="fileInclusion">File inclusion</h3>
</p>

<p class="example">Example: File include
(logback-examples/src/main/java/chapters/configuration/containingConfig.xml)</p>
(logback-examples/src/main/resources/chapters/configuration/containingConfig.xml)</p>

<pre class="prettyprint source">&lt;configuration>
<b>&lt;include file="src/main/java/chapters/configuration/includedConfig.xml"/></b>
Expand All @@ -1963,7 +1963,7 @@ <h3 class="doAnchor" name="fileInclusion">File inclusion</h3>
</p>

<p class="example">Example: File include
(logback-examples/src/main/java/chapters/configuration/includedConfig.xml)</p>
(logback-examples/src/main/resources/chapters/configuration/includedConfig.xml)</p>

<pre class="source"><b class="green big">&lt;included></b>
&lt;appender name="includedConsole" class="ch.qos.logback.core.ConsoleAppender">
Expand Down
20 changes: 10 additions & 10 deletions logback-site/src/site/pages/manual/filters.html
Expand Up @@ -137,7 +137,7 @@ <h3 class="doAnchor" name="yourOwnFilter">Implementing your own
</p>

<em>Example: SampleFilter configuration
(logback-examples/src/main/java/chapters/filters/SampleFilterConfig.xml)</em>
(logback-examples/src/main/resources/chapters/filters/SampleFilterConfig.xml)</em>
<span class="asGroovy" onclick="return asGroovy('SampleFilterConfig');">View as .groovy</span>
<pre id="SampleFilterConfig" class="prettyprint source">&lt;configuration>
&lt;appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
Expand Down Expand Up @@ -194,7 +194,7 @@ <h3 class="doAnchor" name="levelFilter">LevelFilter</h3>
</p>

<em>Example: Sample LevelFilter configuration
(logback-examples/src/main/java/chapters/filters/levelFilterConfig.xml)</em>
(logback-examples/src/main/resources/chapters/filters/levelFilterConfig.xml)</em>
<span class="asGroovy" onclick="return asGroovy('levelFilterConfig');">View as .groovy</span>
<pre id="levelFilterConfig" class="prettyprint source">&lt;configuration>
&lt;appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
Expand Down Expand Up @@ -227,7 +227,7 @@ <h3 class="doAnchor" name="thresholdFilter">ThresholdFilter</h3>
</p>

<em>Example: Sample ThresholdFilter configuration
(logback-examples/src/main/java/chapters/filters/thresholdFilterConfig.xml)</em>
(logback-examples/src/main/resources/chapters/filters/thresholdFilterConfig.xml)</em>
<span class="asGroovy" onclick="return asGroovy('thresholdFilterConfig');">View as .groovy</span>
<pre id="thresholdFilterConfig" class="prettyprint source">&lt;configuration>
&lt;appender name="CONSOLE"
Expand Down Expand Up @@ -529,7 +529,7 @@ <h3 class="doAnchor" name="GEventEvaluator">GEventEvaluator</h3>
<p>Here is a concrete example.</p>

<em>Example: Basic event evaluator usage
(logback-examples/src/main/java/chapters/filters/basicEventEvaluator.xml)</em>
(logback-examples/src/main/resources/chapters/filters/basicEventEvaluator.xml)</em>

<span class="asGroovy" onclick="return asGroovy('basicEventEvaluator');">View as .groovy</span>
<pre id="basicEventEvaluator" class="prettyprint source longline">&lt;configuration>
Expand Down Expand Up @@ -663,7 +663,7 @@ <h2 class="doAnchor" name="matcher">Matchers</h2>

<p>An example should clarify the point:</p>

<em>Example: Defining matchers in an event evaluator (logback-examples/src/main/java/chapters/filters/evaluatorWithMatcher.xml)</em>
<em>Example: Defining matchers in an event evaluator (logback-examples/src/main/resources/chapters/filters/evaluatorWithMatcher.xml)</em>
<span class="asGroovy" onclick="return asGroovy('evaluatorWithMatcher');">View as .groovy</span>

<pre id="evaluatorWithMatcher" class="prettyprint source">&lt;configuration debug="true">
Expand Down Expand Up @@ -820,7 +820,7 @@ <h3 class="doAnchor" name="yourOwnTurboFilter">Implementing your
</p>

<em>Example: Basic custom <code>TurboFilter</code> configuration
(logback-examples/src/main/java/chapters/filters/sampleTurboFilterConfig.xml)</em>
(logback-examples/src/main/resources/chapters/filters/sampleTurboFilterConfig.xml)</em>

<span class="asGroovy" onclick="return asGroovy('sampleTurboFilterConfig');">View as .groovy</span>

Expand Down Expand Up @@ -860,7 +860,7 @@ <h3 class="doAnchor" name="yourOwnTurboFilter">Implementing your

<em>Example: <code>MDCFilter</code> and <code>MarkerFilter</code>
configuration
(logback-examples/src/main/java/chapters/filters/turboFilters.xml)</em>
(logback-examples/src/main/resources/chapters/filters/turboFilters.xml)</em>

<span class="asGroovy" onclick="return asGroovy('turboFilters');">View as .groovy</span>
<pre id="turboFilters" class="prettyprint source">&lt;configuration>
Expand Down Expand Up @@ -989,7 +989,7 @@ <h3 class="doAnchor" name="yourOwnTurboFilter">Implementing your


<em>Example: <code>DuplicateMessageFilter</code>
configuration (logback-examples/src/main/java/chapters/filters/duplicateMessage.xml)</em>
configuration (logback-examples/src/main/resources/chapters/filters/duplicateMessage.xml)</em>

<span class="asGroovy" onclick="return asGroovy('duplicateMessage');">View as .groovy</span>
<pre id="duplicateMessage" class="prettyprint source">&lt;configuration>
Expand Down Expand Up @@ -1149,7 +1149,7 @@ <h3 class="doAnchor" name="access_EvalutorFilter">EvaluatorFilter</h3>
(Not Found)</a> HTTP response code. Every request resulting in a
404 will be printed on the console.</p>

<em>Example: Access Evaluator (logback-examples/src/main/java/chapters/filters/accessEventEvaluator.xml)</em>
<em>Example: Access Evaluator (logback-examples/src/main/resources/chapters/filters/accessEventEvaluator.xml)</em>
<pre class="prettyprint source">&lt;configuration>
&lt;statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" />

Expand All @@ -1171,7 +1171,7 @@ <h3 class="doAnchor" name="access_EvalutorFilter">EvaluatorFilter</h3>
</p>


<em>Example 6.10: Access Evaluator (logback-examples/src/main/java/chapters/filters/accessEventEvaluator2.xml)</em>
<em>Example 6.10: Access Evaluator (logback-examples/src/main/resources/chapters/filters/accessEventEvaluator2.xml)</em>
<pre class="prettyprint source">&lt;configuration>
&lt;statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" />
&lt;appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
Expand Down

0 comments on commit ef579e7

Please sign in to comment.