You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-user@logging.apache.org by john ware <jw...@voicelog.net> on 2006/06/29 00:26:31 UTC

Config file problem

Hi,
    I built a copy of log4cxx-0.9.8 on windows and now my app won't 
write to the log file. It was working fine using the previous version.

    There is a message sent to the console "log4cxx: No output stream or 
file set for the appender named [FILE].".

    The "EventLog" appender works just fine so I figure it is a config 
issue. My config file is below.
   
    If someone can point out what needs to be changed, I would be most 
appreciative.

thanks

john



<?xml version="1.0" encoding="UTF-8" ?>
 
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
 
  <appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender">
    <param name="File" value="log/server.log" />
    <param name="Append" value="true" />
    <param name="DatePattern" value=".%Y-%m-%d" />
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
    </layout>
  </appender>
 
  <appender name="EventLog" class="org.apache.log4j.nt.NTEventLogAppender">
    <param name="source" value="CallRecordingEngine" />
    
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%m%n"/>
    </layout>
  </appender>
 
  <category name="EventLog">
    <priority value="INFO" />
    <appender-ref ref="EventLog" />
  </category>
 
  <root>
    <priority value="DEBUG" />
    <appender-ref ref="FILE" />
  </root>
  
</log4j:configuration>


Re: Config file problem

Posted by Curt Arnold <ca...@apache.org>.
On Jun 28, 2006, at 5:26 PM, john ware wrote:

> Hi,
>    I built a copy of log4cxx-0.9.8 on windows and now my app won't  
> write to the log file. It was working fine using the previous version.
>
>    There is a message sent to the console "log4cxx: No output  
> stream or file set for the appender named [FILE].".
>
>    The "EventLog" appender works just fine so I figure it is a  
> config issue. My config file is below.
>      If someone can point out what needs to be changed, I would be  
> most appreciative.
>
> thanks
>
> john
>

log4j 1.3 has two distinct classes named RollingFileAppender, one in  
org.apache.log4j and a new architecture one in  
org.apache.log4j.rolling.  The log4cxx RFA is based on the new  
o.a.l.rolling.RFA and uses its configuration syntax (which would  
contain elements for triggeringPolicy and rollingPolicy).  It is on  
the to-do list to support both the old-style and new-style  
configuration, however at the current time the log4cxx class file  
mapping does not make any distinction based on the package name, it  
only looks at the terminal class name.  Here is an example of  
configuration of RFA from the log4cxx unit tests:


   <appender name="ROLL"  
class="org.apache.log4j.rolling.RollingFileAppender">
     <rollingPolicy  
class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
       <param name="fileNamePattern" value="output/test1-%d{yyyy-MM- 
dd_HH_mm_ss}"/>
     </rollingPolicy>

     <layout class="org.apache.log4j.PatternLayout">
       <param name="ConversionPattern" value="%c{1} - %m%n"/>
     </layout>	
   </appender>