Schaible, J�rg wrote:
Hi Berin,
In your logger manager configuration file, use a stream log target:
<stream/> <!-- defaults to System.err -->
<stream>System.out</stream> <!-- use System.out -->
The best thing to help would be a copy of the logger manager
configuration file.
Basically it is the one from the Fortress servlet example. I've added all the stream stuff. Here it comes:
=========== snip ============
<logkit>
<factories>
<factory type="file" class="org.apache.avalon.excalibur.logger.factory.FileTargetFactory"/>
<factory type="stream" class="org.apache.avalon.excalibur.logger.factory.StreamTargetFactory"/>
</factories>
<targets>
<file id="root">
<filename>fortress-examples.log</filename>
<format type="extended">
%7.7{priority} %5.5{time} [%8.8{category}] (%{context}): %{message}\n%{throwable}
</format>
</file>
<stream id="root">System.out</stream>
</targets>
<categories>
<category name="" log-level="DEBUG">
<log-target id-ref="root"/>
</category>
</categories>
</logkit>
=========== snap ============
The console stream works now perfectly, but still no log file. Where should it be located? In the work or context directory? Or do I have to set another location in the initilization phase?
The way the Logkit config file works is this:
Each target needs to have its own id. If you want the root stuff to go
both to the file and the stream, you would give them separate id's, and
assign them like this:
<category name="" log-level="DEBUG">
<log-target id-ref="file"/>
<log-target id-ref="sysout"/>
</category>
What you have is not valid XML (you cannot have any 'id' attribute
that is a duplicate). I am surprised it is read by the XML parser.
Also the filename is always placed relative to the context directory.
That is per the "logger" package which Fortress uses. If you use an
absolute path, you will have your log files placed at that absolute
location. If it is relative, then it is from the context directory.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]