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 Arunkumar <av...@appsecinc.com> on 2006/05/23 16:49:05 UTC

Logs from debug and release builds

Hi Curt,

I downloaded the latest tar.gz from the littletux site.

DEBUG BUILD:
The default debug build succeeded in making the dll but the unit test
failed.
Following were the settings I used b4 doing the build.

set CLASSPATH=C:\Program
Files\apache-ant-1.6.5\lib\ant-contrib.jar;C:\Program
Files\apache-ant-1.6.5\lib\cpptasks.jar;C:\Program Files\Microsoft Visual
Studio .NET 2003\Vc7\bin;

set PATH=%PATH%;C:\Program Files\apache-ant-1.6.5\bin;C:\Program
Files\Java\jre1.5.0_06\bin

Then I ran the vcvars.bat manually just to be sure that it uses the vs.net
2003 stuff.
Then I called ant -f build.xml -logfile="build_default.txt"

RELEASE BUILD
Same settings as above.
I changed the ant command to: 
ant -f build.xml -logfile="build_default.txt" -Ddebug=false
-Dlogchar=wchar_t

It built the release dll but the unit tests failed. 

I have attached both the log files. Let me know if you guys need anything
else.

Thanks
Arun

AW: Question: MaxBackupIndex RollinfIleappender XML config Howto

Posted by LECHNER Martin <Ma...@frequentis.com>.
Just tested it - seems to work perfectly.
Thanks a lot for your help!
 
ML

________________________________

Von: Arunkumar [mailto:aviswanathan@appsecinc.com]
Gesendet: Mi 24.05.2006 17:20
An: 'Log4CXX User'
Betreff: RE: Question: MaxBackupIndex RollinfIleappender XML config Howto



Hi Martin,

This is a file that I used to test the rolling file appender and it worked.
I used one of the unit test xml input files and modified it.
Replace the values as per your requirements. Also replace
testcxxlogging.level2.l2r and testcxxlogging.level2.l2r.c1 with your logger
names. I defined these loggers in a parent and child class respectively.

-Arun

<?xml version="1.0" encoding="UTF-8" ?>

<log4j:configuration xmlns:log4j='http://logging.apache.org/' debug="true">

  <appender name="ROLLING"
class="org.apache.log4j.rolling.RollingFileAppender">
    <rollingPolicy
class="org.apache.log4j.rolling.FixedWindowRollingPolicy">
       <param name="fileNamePattern" value="filterBased-test.%i.log"/>
       <param name="minIndex" value="0"/>       
         <param name="maxIndex" value="3" />
    </rollingPolicy>
       
        <triggeringPolicy
class="org.apache.log4j.SizeBasedTriggeringPolicy">
                <param name="MaxFileSize" value="2KB"/>    
        </triggeringPolicy>

        <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%m%n"/>
    </layout>
    <param name="file" value="filterBased-test.log"/>
    <param name="append" value="true"/>

  </appender>

  <logger name="testcxxlogging.level2.l2r" additivity="true">
    <appender-ref ref="ROLLING"/>
    <level value="info"/>
  </logger>

  <logger name="testcxxlogging.level2.l2r.c1" additivity="false">
    <appender-ref ref="ROLLING"/>
    <level value="warn"/>
  </logger>

</log4j:configuration>

________________________________________
From: log4cxx-user-return-1568-aviswanathan=appsecinc.com@logging.apache.org
[mailto:log4cxx-user-return-1568-aviswanathan=appsecinc.com@logging.apache.o
rg] On Behalf Of LECHNER Martin
Sent: Wednesday, May 24, 2006 7:02 AM
To: Log4CXX User
Subject: AW: Question: MaxBackupIndex RollinfIleappender XML config Howto

 
Unfortuantely the configuration does not work.
I still get 7 backup files (seems to be the default in
FixedWindowRollingPolicy)
 
Is there still an error in the config file?
 
best regards
ML
 
 
 
 
 






RE: Question: MaxBackupIndex RollinfIleappender XML config Howto

Posted by Arunkumar <av...@appsecinc.com>.
Hi Martin,

This is a file that I used to test the rolling file appender and it worked.
I used one of the unit test xml input files and modified it.
Replace the values as per your requirements. Also replace
testcxxlogging.level2.l2r and testcxxlogging.level2.l2r.c1 with your logger
names. I defined these loggers in a parent and child class respectively.

-Arun

<?xml version="1.0" encoding="UTF-8" ?>

<log4j:configuration xmlns:log4j='http://logging.apache.org/' debug="true">

  <appender name="ROLLING"
class="org.apache.log4j.rolling.RollingFileAppender">
    <rollingPolicy
class="org.apache.log4j.rolling.FixedWindowRollingPolicy">
       <param name="fileNamePattern" value="filterBased-test.%i.log"/>
       <param name="minIndex" value="0"/>	 
	 <param name="maxIndex" value="3" />
    </rollingPolicy>
	
	<triggeringPolicy
class="org.apache.log4j.SizeBasedTriggeringPolicy">
		<param name="MaxFileSize" value="2KB"/>	    
	</triggeringPolicy>

	<layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%m%n"/>
    </layout>
    <param name="file" value="filterBased-test.log"/>
    <param name="append" value="true"/>

  </appender>

  <logger name="testcxxlogging.level2.l2r" additivity="true">
    <appender-ref ref="ROLLING"/>
    <level value="info"/>
  </logger>

  <logger name="testcxxlogging.level2.l2r.c1" additivity="false">
    <appender-ref ref="ROLLING"/>
    <level value="warn"/>
  </logger>

</log4j:configuration>

________________________________________
From: log4cxx-user-return-1568-aviswanathan=appsecinc.com@logging.apache.org
[mailto:log4cxx-user-return-1568-aviswanathan=appsecinc.com@logging.apache.o
rg] On Behalf Of LECHNER Martin
Sent: Wednesday, May 24, 2006 7:02 AM
To: Log4CXX User
Subject: AW: Question: MaxBackupIndex RollinfIleappender XML config Howto

 
Unfortuantely the configuration does not work. 
I still get 7 backup files (seems to be the default in
FixedWindowRollingPolicy)
 
Is there still an error in the config file?
 
best regards
ML
 
 
 
 
 




AW: Question: MaxBackupIndex RollinfIleappender XML config Howto

Posted by LECHNER Martin <Ma...@frequentis.com>.
 
Unfortuantely the configuration does not work. 
I still get 7 backup files (seems to be the default in
FixedWindowRollingPolicy)
 
Is there still an error in the config file?
 
best regards
ML
 
 
 

 

 





Re: Question: MaxBackupIndex RollinfIleappender XML config Howto

Posted by Curt Arnold <ca...@apache.org>.
On May 23, 2006, at 10:05 AM, LECHNER Martin wrote:

> I try to figure aut how to configure the MaxBackupIndex property  
> with an xml
> config file.
>
> The file looks like below and it does not work.
> Any suggestions?
>
>
>   <appender name="RootFileApp" class="RollingFileAppender">
>     <param name="File" value="log_root.txt" />
>     <param name="append" value="false" />
>     <param name="MaxBackupIndex" value="5" />
>     <triggeringPolicy  
> class="org.apache.log4j.SizeBasedTriggeringPolicy">
>       <param name="MaxFileSize" value="10KB"/>
>     </triggeringPolicy>
>     <layout class="org.apache.log4j.PatternLayout">
>       <param name="ConversionPattern"  value="%d[%t] %-5p %c %x - % 
> m %n"/>
>     </layout>
>   </appender>
>
> Best regards
> ML
> <winmail.dat>


log4cxx implements the log4j 1.3 style rolling file appender (that is  
org.apache.log4j.rolling.RollingFileAppender vs  
org.apache.log4j.RollingFileAppender).  We haven't reworked the XML  
configuration reader so it could support two different classes with  
name that differ only in package name.

Your configuration file looks like a mix of o.a.l.RFA configuration  
and o.a.l.r.RFA configuration.  MaxBackupIndex is used by o.a.l.RFA  
and triggeringPolicy by o.a.l.r.RFA.

Unfortunately, there is not a test in either log4j or log4cxx that  
contains an example of setting up a size based o.a.l.r.RFA.  I think  
this sample is closer (and likely works for log4j), but I haven't  
tested it with log4cxx.

   <appender name="RootFileApp"  
class="org.apache.log4j.rolling.RollingFileAppender">
     <rollingPolicy  
class="org.apache.log4j.rolling.FixedWindowRollingPolicy">
        <param name="maxIndex" value="5"/>
     </rollingPolicy>
     <triggeringPolicy  
class="org.apache.log4j.SizeBasedTriggeringPolicy">
       <param name="MaxFileSize" value="10KB"/>
   </triggeringPolicy>
   <layout class="org.apache.log4j.PatternLayout">
       <param name="ConversionPattern"  value="%d[%t] %-5p %c %x - %m  
%n"/>
     </layout>
     <param name="file" value="log_root.txt"/>
     <param name="append" value="false"/>
   </appender>


Question: MaxBackupIndex RollinfIleappender XML config Howto

Posted by LECHNER Martin <Ma...@frequentis.com>.
I try to figure aut how to configure the MaxBackupIndex property with an xml
config file.
 
The file looks like below and it does not work.
Any suggestions?
 
 
  <appender name="RootFileApp" class="RollingFileAppender">
    <param name="File" value="log_root.txt" />
    <param name="append" value="false" />
    <param name="MaxBackupIndex" value="5" />
    <triggeringPolicy class="org.apache.log4j.SizeBasedTriggeringPolicy">
      <param name="MaxFileSize" value="10KB"/>
    </triggeringPolicy>
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern"  value="%d[%t] %-5p %c %x - %m %n"/>
    </layout>
  </appender>

Best regards
ML

Re: Logs from debug and release builds

Posted by Curt Arnold <ca...@apache.org>.
The build_default.txt log indicates that a copy of "sed" could not be  
found on the path.  The requirement to have sed and patch is listed  
at the top of INSTALL.  I'd recommend installing cygwin (http:// 
www.cygwin.com) and placing it on the path (but after MSVC so that  
MSVC's link will be used instead of Cygwin's).  When installing  
Cygwin, press the View button to go into Full view and then check  
that patchutil and sed are selected for installation.

Before running ant, check that sed, patch and link are all present.   
Do something like:

path c:\cygwin\bin;%PATH%
"c:\program files\microsoft visual studio 2001\vc7\bin\vcvars32"
sed -h   ' should return an illegal option message
patch -version ' should return a version and copyright notice
link /? ' should return a Microsoft copyright and list of options (if  
you get "Too few arguments, you have cygwin on path first).


The second is funky.  Looks as if the tests/output directory may have  
been deleted.  I would have thought that it would have failed in the  
same way as the first run.




On May 23, 2006, at 9:49 AM, Arunkumar wrote:

> <build_default.txt>