You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by "Wilfong, Paul" <pa...@ngc.com> on 2007/09/18 18:35:18 UTC

log4j -- Problem trying to build "receivers companion"

On Sep 14, 2007; 10:29am, Curt Arnold wrote
(http://mail-archives.apache.org/mod_mbox/logging-log4j-user/200709.mbox
/browser):
>>>To build it assuming Maven 2.0.7 is on the path:
>>>
>>> $ svn co https://svn.apache.org/repos/asf/logging/log4j/companions/ 
>>> receivers/trunk receivers
>>> $ cd receivers
>>> $ mvn package

When I try to do the mvn package step, I get a build failure, as
follows:
Results :
Failed tests:
  testMapPolicy(org.apache.log4j.rewrite.RewriteAppenderTest)
Tests run: 10, Failures: 1, Errors: 0, Skipped: 0
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] There are test failures.
[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 12 seconds
[INFO] Finished at: Tue Sep 18 07:42:24 PDT 2007
[INFO] Final Memory: 10M/19M
[INFO]
------------------------------------------------------------------------

This is just the end of the mvn output, which is voluminous.  There are
also surefire-reports files.  I have pasted the one for the
RewriteAppenderTest below.

It appears to me that there is no receivers jar file created.

Any assistance would sure be appreciated.  My overall goal is to use the
XMLSocketAppender, which I was able to get going under 1.3, but now am
trying to migrate back to 1.2.15.


org.apache.log4j.rewrite.RewriteAppenderTest.txt:
------------------------------------------------------------------------
-------
Test set: org.apache.log4j.rewrite.RewriteAppenderTest
------------------------------------------------------------------------
-------
Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.047
sec <<< FAILURE!
testMapPolicy(org.apache.log4j.rewrite.RewriteAppenderTest)  Time
elapsed: 0.016 sec  <<< FAILURE!
junit.framework.AssertionFailedError
	at junit.framework.Assert.fail(Assert.java:47)
	at junit.framework.Assert.assertTrue(Assert.java:20)
	at junit.framework.Assert.assertTrue(Assert.java:27)
	at
org.apache.log4j.rewrite.RewriteAppenderTest.testMapPolicy(RewriteAppend
erTest.java:71)
	at
org.apache.log4j.rewrite.RewriteAppenderTest.testMapPolicy(RewriteAppend
erTest.java:71)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at junit.framework.TestCase.runTest(TestCase.java:154)
	at junit.framework.TestCase.runBare(TestCase.java:127)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:118)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at
org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:2
13)
	at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSe
t(AbstractDirectoryTestSuite.java:138)
	at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(Abstr
actDirectoryTestSuite.java:125)
	at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(Suref
ireBooter.java:290)
	at
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java
:818)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Question: Does Chainsaw read non XML logs?

Posted by Paul Smith <ps...@aconex.com>.
Sure it can, you just need to setup a LogFilePatternReceiver and  
provide it with the pattern of you logging file:

http://logging.apache.org/log4j/companions/receivers/xref/org/apache/ 
log4j/varia/LogFilePatternReceiver.html

Paul
On 19/09/2007, at 7:42 AM, Siegel, Bernard J. wrote:

> Folks,
> This from the Chainsaw site:
> "Chainsaw can read log files formatted in Log4j's XMLLayout, receive
> events from remote locations, read events from a DB, it can even work
> with the JDK 1.4 logging events."
> A co-worker asserted Chainsaw only works with XML formatted logs.
> Is this correct?
> Can it read logs written by Log4j in plain text format?
> Thank you,
>
> Bernard Siegel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>

Paul Smith
Core Engineering Manager

Aconex
The easy way to save time and money on your project

696 Bourke Street, Melbourne,
VIC 3000, Australia
Tel: +61 3 9240 0200  Fax: +61 3 9240 0299
Email: psmith@aconex.com  www.aconex.com

This email and any attachments are intended solely for the addressee.  
The contents may be privileged, confidential and/or subject to  
copyright or other applicable law. No confidentiality or privilege is  
lost by an erroneous transmission. If you have received this e-mail  
in error, please let us know by reply e-mail and delete or destroy  
this mail and all copies. If you are not the intended recipient of  
this message you must not disseminate, copy or take any action in  
reliance on it. The sender takes no responsibility for the effect of  
this message upon the recipient's computer system.




Re: Question: Does Chainsaw read non XML logs?

Posted by Wim Deblauwe <wi...@gmail.com>.
If you want an easier way to read plain text files, check out Vigilog. The
new version (that will be released soon) is avaible as webstart at
http://vigilog.sourceforge.net/staging/. There is no need to convert you
conversionPattern like in Chainsaw.

regards,

Wim

2007/9/18, Siegel, Bernard J. <bs...@swri.org>:
>
> Folks,
> This from the Chainsaw site:
> "Chainsaw can read log files formatted in Log4j's XMLLayout, receive
> events from remote locations, read events from a DB, it can even work
> with the JDK 1.4 logging events."
> A co-worker asserted Chainsaw only works with XML formatted logs.
> Is this correct?
> Can it read logs written by Log4j in plain text format?
> Thank you,
>
> Bernard Siegel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>


-- 
Vigilog - an open source log file viewer: http://vigilog.sourceforge.net
Blog: http://www.jroller.com/page/Fester

Question: Does Chainsaw read non XML logs?

Posted by "Siegel, Bernard J." <bs...@swri.org>.
Folks,
This from the Chainsaw site:
"Chainsaw can read log files formatted in Log4j's XMLLayout, receive
events from remote locations, read events from a DB, it can even work
with the JDK 1.4 logging events."
A co-worker asserted Chainsaw only works with XML formatted logs.
Is this correct?
Can it read logs written by Log4j in plain text format?
Thank you, 

Bernard Siegel

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


RE: log4j -- Problem trying to build "receivers companion"

Posted by "Wilfong, Paul" <pa...@ngc.com>.
It worked!  Thanks Curt.

I did the svn update and tried again.  This time got through the tests,
got Build Successful at the end, and I now have a jar file!

(By the way this is using JDK jdk1.6.0_02 on Windows XP 2002.)

-----Original Message-----
From: Wilfong, Paul [mailto:paul.wilfong@ngc.com] 
Sent: Tuesday, September 18, 2007 11:22 AM
To: Log4J Users List
Subject: RE: log4j -- Problem trying to build "receivers companion"

On Tuesday, September 18, 2007 11:13 AM, Curt Arnold wrote:

>>> The Maven console output should contain a section where it describes
the  
>>> different between the generated file and the reference file.  Look 
>>> for line starting with "INFO
org.apache.log4j.rewrite.RewriteAppenderTest".

You are right - I was reluctant to copy Maven console output into my
post because there was so much and I wasn't sure what would be relevant
and/or of interest.

>>> svn update and try again and if it still fails, report JDK,  
>>> platform and the section of the console output that shows the  
>>> comparison between temp and map.log.

Will do - Thanks...



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


RE: log4j -- Problem trying to build "receivers companion"

Posted by "Wilfong, Paul" <pa...@ngc.com>.
On Tuesday, September 18, 2007 11:13 AM, Curt Arnold wrote:

>>> The Maven console output should contain a section where it describes
the  
>>> different between the generated file and the reference file.  Look  
>>> for line starting with "INFO
org.apache.log4j.rewrite.RewriteAppenderTest".

You are right - I was reluctant to copy Maven console output into my
post because there was so much and I wasn't sure what would be relevant
and/or of interest.

>>> svn update and try again and if it still fails, report JDK,  
>>> platform and the section of the console output that shows the  
>>> comparison between temp and map.log.

Will do - Thanks...



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: log4j -- Problem trying to build "receivers companion"

Posted by Curt Arnold <ca...@apache.org>.
On Sep 18, 2007, at 11:35 AM, Wilfong, Paul wrote:

> On Sep 14, 2007; 10:29am, Curt Arnold wrote
> (http://mail-archives.apache.org/mod_mbox/logging-log4j-user/ 
> 200709.mbox
> /browser):
>>>> To build it assuming Maven 2.0.7 is on the path:
>>>>
>>>> $ svn co https://svn.apache.org/repos/asf/logging/log4j/companions/
>>>> receivers/trunk receivers
>>>> $ cd receivers
>>>> $ mvn package
>
> When I try to do the mvn package step, I get a build failure, as
> follows:
> Results :
> Failed tests:
>   testMapPolicy(org.apache.log4j.rewrite.RewriteAppenderTest)
> Tests run: 10, Failures: 1, Errors: 0, Skipped: 0
> [INFO]
> ---------------------------------------------------------------------- 
> --
> [ERROR] BUILD FAILURE
> [INFO]
> ---------------------------------------------------------------------- 
> --
> [INFO] There are test failures.
> [INFO]
> ---------------------------------------------------------------------- 
> --
> [INFO] For more information, run Maven with the -e switch
> [INFO]
> ---------------------------------------------------------------------- 
> --
> [INFO] Total time: 12 seconds
> [INFO] Finished at: Tue Sep 18 07:42:24 PDT 2007
> [INFO] Final Memory: 10M/19M
> [INFO]
> ---------------------------------------------------------------------- 
> --
>
> This is just the end of the mvn output, which is voluminous.  There  
> are
> also surefire-reports files.  I have pasted the one for the
> RewriteAppenderTest below.
>
> It appears to me that there is no receivers jar file created.
>
> Any assistance would sure be appreciated.  My overall goal is to  
> use the
> XMLSocketAppender, which I was able to get going under 1.3, but now am
> trying to migrate back to 1.2.15.
>
>
> org.apache.log4j.rewrite.RewriteAppenderTest.txt:
> ---------------------------------------------------------------------- 
> --
> -------
> Test set: org.apache.log4j.rewrite.RewriteAppenderTest
> ---------------------------------------------------------------------- 
> --
> -------
> Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.047
> sec <<< FAILURE!
> testMapPolicy(org.apache.log4j.rewrite.RewriteAppenderTest)  Time
> elapsed: 0.016 sec  <<< FAILURE!
> junit.framework.AssertionFailedError
> 	at junit.framework.Assert.fail(Assert.java:47)
> 	at junit.framework.Assert.assertTrue(Assert.java:20)
>

The build is failing on RewriteAppenderTest.testMapPolicy where it  
compares the generated file (written in target/temp) with a reference  
file (src/test/resources/org/apache/log4j/rewrite/map.log).  The  
Maven console output should contain a section where it describes the  
different between the generated file and the reference file.  Look  
for line starting with "INFO  
org.apache.log4j.rewrite.RewriteAppenderTest".

The unit tests must pass before a jar can be created, so that a jar  
was not built in a feature.

Looking at the test, I'm guessing that it is due to an inconsistent  
result from HashMap.toString().  It is most likely that the keys  
appeared in different order (since HashMap isn't ordered) or perhaps,  
different locale settings resulted in different separators.  If it is  
the first, then perhaps switching line 64 to

Map msg = new TreeMap();

would make the results consistent.  I've committed that change in rev  
577008.  svn update and try again and if it still fails, report JDK,  
platform and the section of the console output that shows the  
comparison between temp and map.log.



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org