avalon-phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leif Mortenson <l...@tanukisoftware.com>
Subject Re: How to enable console logging in Phoenix
Date Sat, 23 Nov 2002 00:54:14 GMT
    The problem is that you are redefining the same log category twice. 
 The second
one loading is overwriting the first most likely.  Unfortunately, logkit 
does not support
different log levels for different log targets (At least not that I am 
aware of :-)

    You need to change your categories section as follows:

<category name="model-runner" log-level="DEBUG">
    <log-target id-ref="model-runner-target"/>
    <log-target id-ref="model-runner-target-info"/>


mati wrote:

>><logs version="1.1">
>>      +   Factories define various types of output targets for log
>>      +-->
>><factory type="stream"
>>class="org.apache.avalon.excalibur.logger.factory.StreamTargetFactory"/ >
>><!--+ TARGETS
>>      +   Targets are named destinations of log events. Tag names for
>>      +   elements, such as 'file' or 'screen', correspond to factory
>>types above.
>>      +-->
>><!-- Outputs events to the screen. -->
>><stream id="sout">
>>                 <stream>System.out</stream>
>><format type="avalon">%8.8{priority} %{time:(yyyy-MM-dd)
>>HH:mm.ss:SSS} [%8.8{category}] (%{thread}) %{class:short}:
>>      +   Categories are named sinks for the application to output
>>events to.
>>      +   First level category names correspond to block names in
>>      +
>>      +   Each category has an attribute named log-level that
>>controls the severity
>>      +   of messages to records. Valid severities are:
>>      +
>>      +   Each category can have children of other categories, and
>>log-target elements
>>      +   log-target elements have an id-ref attribute that
>>references the id of a target
>>      +   in the targets section.
>>      +-->
>><!-- anything that doesn't fit into the above categories falls into
>>here -->
>><category name="" log-level="DEBUG">
>>                 <log-target id-ref="sout"/>
>I am trying to log to two targets at the same time and it fails. It just
>logs to one or another. Here is sample conf:
>    <factory type="file"
>    <factory type="stream"
><category name="model-runner" log-level="DEBUG">
>    <log-target id-ref="model-runner-target"/>
><category name="model-runner" log-level="INFO">
><log-target id-ref="model-runner-target-info"/>
><file id="model-runner-target">
>    <filename>${app.home}/logs/model-runner.log</filename>
>    <format>%{time:dd/MM/yy HH:mm:ss} %5.5{priority} %{category}:
>%{message}\n%{throwable}    </format>
>    <append>true</append>
><stream id="model-runner-target-info">
>    <stream>System.out</stream>
>    <format type="avalon">%{time: HH:mm.ss:SSS} %{class:short}: %{message}
>And it doesn't seem to work out
>Could somebody help me solve this so that it is logged to console and to
>Is it even possible to use two targets at the same time
>Mateusz Szczap
>To unsubscribe, e-mail:   <mailto:avalon-phoenix-dev-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:avalon-phoenix-dev-help@jakarta.apache.org>

To unsubscribe, e-mail:   <mailto:avalon-phoenix-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-phoenix-dev-help@jakarta.apache.org>

View raw message