logo       

Re: Config file problem: msg#00039

Subject: Re: Config file problem
That works nicely, thank you.

 Now,
I looked at the doc for TimeBasedRollingPolicy and am trying to use the ActiveFileName property so that my active file name is server.log and then the archived file has the timestamp appended, but, I am doing something wrong.

The doc states:

"The active file is defined as the log file for the current period whereas archived files are those files which have been rolled over in previous periods. By setting the ActiveFileName option you can decouple the location of the active log file and the location of the archived log files."


Here is how I tried to modify what you sent me.

 <appender name="FILE"  class="org.apache.log4j.rolling.RollingFileAppender">
    <rollingPolicy  class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
      <param name="FileNamePattern" value="log/server.log-%d{yyyy-MM-dd}"/>
      <param name="ActiveFileName" value="log/server.log" />
    </rollingPolicy>

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

Is this how one is supposed to use the ActiveFileName option?

thanks

john









Curt Arnold wrote:

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>


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe