[logback-user] DBAppender and markers

Leonardo Souza lsouza at amtera.com.br
Mon Jun 17 15:44:19 CEST 2013


Hi David,

Here is my outputs.

$ git show --summary
commit 2a73e043e149693fcd0ad2f90b04702c2dba4851
Author: Ceki Gulcu <ceki at qos.ch>
Date:   Fri Jun 14 11:55:05 2013 +0200

$ javac -version
javac 1.6.0_41

$ mvn -version
Apache Maven 3.0.4
Maven home: /usr/share/maven
Java version: 1.6.0_41, vendor: Sun Microsystems Inc.
Java home: /usr/lib/jvm/java-6-sun-1.6.0.41/jre
Default locale: pt_BR, platform encoding: UTF-8
OS name: "linux", version: "3.2.0-32-generic", arch: "amd64", family: "unix"


First run:

$ mvn clean install

Results :

Failed tests:
  TimeUtilTest.testDay:74 expected:<1164078000000> but was:<1164074400000>
  TimeUtilTest.testWeek:100 expected:<1164596400000> but was:<1164592800000>
  TimeUtilTest.testMonth:115 expected:<1164942000000> but
was:<1164938400000>
  RollingCalendarTest.testVaryingNumberOfDailyPeriods:92 p=13
expected:<1224381600000> but was:<1224385200000>

Tests run: 445, Failures: 4, Errors: 0, Skipped: 6


Suspecting of some timezone issues. My default timezone is
America/Sao_Paulo.

Second run:

$ mvn -Duser.timezone=CET clean install

Results :

Failed tests:
  MDCBasedDiscriminatorTest.nullMDC:75 expected:<{}> but
was:<{compositeProperty=1763803913, max=1559727973,
linger=session1424346104, userId=user3,
propertyDefinedWithinSift=1694640543, localProperty=848086231}>

Tests run: 417, Failures: 1, Errors: 0, Skipped: 16



 I have attached the reported failures.

regards,



-- 
Leonardo S Souza
Amtera Semantic Technologies
Rua da Quitanda, 194, sala 1201 - Centro
Rio de Janeiro - RJ - Brasil
Tel: + 55 21 2213 3220
Cel: + 55 21 9877 7081
www.amtera.com.br


2013/6/16 David Roussel <nabble at diroussel.xsmail.com>

> Leonardo,
>
> I just tried a "mvm clean install" on:
>
> commit 2a73e043e149693fcd0ad2f90b04702c2dba4851
> Author: Ceki Gulcu <ceki at qos.ch>
> Date:   Fri Jun 14 11:55:05 2013 +0200
>
> It built successfully.  I was using Java 1.7.0_17.
>
> What failed for you?
>
> David
>
>
>
> On 14 Jun 2013, at 17:49, Leonardo Souza <lsouza at amtera.com.br> wrote:
>
> Hi,
>
> Thanks for the quick reply. I have been busy so sorry for the late answer.
> The plan is to provide a patch for the DBAppender asap.
>
> I have cloned the repo and issued a mvn clean test, detected some test
> failures.
> This is the trunk version (2.0.0-SNAPSHOT), but there's no snapshot
> version tag to fill a bug in Jira.
> Can i fill the issue without an affected version?
>
> regards,
>
> --
> Leonardo S Souza
> Amtera Semantic Technologies
> Rua da Quitanda, 194, sala 1201 - Centro
> Rio de Janeiro - RJ - Brasil
> Tel: + 55 21 2213 3220
> Cel: + 55 21 9877 7081
> www.amtera.com.br
>
>
> 2013/5/31 ceki <ceki at qos.ch>
>
>>
>> Hi Leonardo,
>>
>> Marker information should be part of the data written into the DB. Please
>> create a jira issue for this bug. Better yet, provide a patch to DBAppender
>> by way of a github pull request.
>>
>> Best regards,
>>
>>
>> On 31.05.2013 03:34, Leonardo Souza wrote:
>>
>>> Hi,
>>>
>>> We have a system with a lot of log statements using markers,
>>>
>>>    this.logger.info(this.marker, "ex fvmo dare lvcem");
>>>
>>> We are planning to store the logs in a database using DBAppender but
>>> ther marker do not have a column, only appears in the
>>> formatted_message field. We will query this database filtering by the
>>> markers, a sql like query is not a desirable solution.
>>>
>>> Anyone has a better idea instead of creating a custom appender?
>>>
>>> thanks ..
>>>
>>> --
>>> Leonardo S Souza
>>>
>>
>>
>> --
>> Ceki
>> 65% of statistics are made up on the spot
>> ______________________________**_________________
>> Logback-user mailing list
>> Logback-user at qos.ch
>> http://mailman.qos.ch/mailman/**listinfo/logback-user<http://mailman.qos.ch/mailman/listinfo/logback-user>
>>
>
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://mailman.qos.ch/mailman/listinfo/logback-user
>
>
>
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://mailman.qos.ch/mailman/listinfo/logback-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20130617/401a4b83/attachment-0001.html>
-------------- next part --------------
-------------------------------------------------------------------------------
Test set: ch.qos.logback.classic.sift.MDCBasedDiscriminatorTest
-------------------------------------------------------------------------------
Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.015 sec <<< FAILURE!
nullMDC(ch.qos.logback.classic.sift.MDCBasedDiscriminatorTest)  Time elapsed: 0.011 sec  <<< FAILURE!
java.lang.AssertionError: expected:<{}> but was:<{compositeProperty=1692578148, max=235105243, linger=session2010191182, userId=user3, propertyDefinedWithinSift=234757556, localProperty=1599624026}>
	at org.junit.Assert.fail(Assert.java:93)
	at org.junit.Assert.failNotEquals(Assert.java:647)
	at org.junit.Assert.assertEquals(Assert.java:128)
	at org.junit.Assert.assertEquals(Assert.java:147)
	at ch.qos.logback.classic.sift.MDCBasedDiscriminatorTest.nullMDC(MDCBasedDiscriminatorTest.java:75)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:208)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:159)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:87)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:95)

smoke(ch.qos.logback.classic.sift.MDCBasedDiscriminatorTest)  Time elapsed: 0.001 sec
-------------- next part --------------
-------------------------------------------------------------------------------
Test set: ch.qos.logback.core.rolling.helper.RollingCalendarTest
-------------------------------------------------------------------------------
Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.053 sec <<< FAILURE!
testPeriodicity(ch.qos.logback.core.rolling.helper.RollingCalendarTest)  Time elapsed: 0.013 sec
testVaryingNumberOfHourlyPeriods(ch.qos.logback.core.rolling.helper.RollingCalendarTest)  Time elapsed: 0.03 sec
testVaryingNumberOfDailyPeriods(ch.qos.logback.core.rolling.helper.RollingCalendarTest)  Time elapsed: 0.006 sec  <<< FAILURE!
junit.framework.AssertionFailedError: p=13 expected:<1224381600000> but was:<1224385200000>
	at junit.framework.Assert.fail(Assert.java:50)
	at junit.framework.Assert.failNotEquals(Assert.java:287)
	at junit.framework.Assert.assertEquals(Assert.java:67)
	at junit.framework.Assert.assertEquals(Assert.java:134)
	at ch.qos.logback.core.rolling.helper.RollingCalendarTest.testVaryingNumberOfDailyPeriods(RollingCalendarTest.java:92)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at junit.framework.TestCase.runTest(TestCase.java:168)
	at junit.framework.TestCase.runBare(TestCase.java:134)
	at junit.framework.TestResult$1.protect(TestResult.java:110)
	at junit.framework.TestResult.runProtected(TestResult.java:128)
	at junit.framework.TestResult.run(TestResult.java:113)
	at junit.framework.TestCase.run(TestCase.java:124)
	at junit.framework.TestSuite.runTest(TestSuite.java:243)
	at junit.framework.TestSuite.run(TestSuite.java:238)
	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:208)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:159)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:87)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:95)

-------------- next part --------------
-------------------------------------------------------------------------------
Test set: ch.qos.logback.core.util.TimeUtilTest
-------------------------------------------------------------------------------
Tests run: 6, Failures: 3, Errors: 0, Skipped: 0, Time elapsed: 0.034 sec <<< FAILURE!
testSecond(ch.qos.logback.core.util.TimeUtilTest)  Time elapsed: 0 sec
testMinute(ch.qos.logback.core.util.TimeUtilTest)  Time elapsed: 0 sec
testHour(ch.qos.logback.core.util.TimeUtilTest)  Time elapsed: 0 sec
testDay(ch.qos.logback.core.util.TimeUtilTest)  Time elapsed: 0.013 sec  <<< FAILURE!
java.lang.AssertionError: expected:<1164078000000> but was:<1164074400000>
	at org.junit.Assert.fail(Assert.java:93)
	at org.junit.Assert.failNotEquals(Assert.java:647)
	at org.junit.Assert.assertEquals(Assert.java:128)
	at org.junit.Assert.assertEquals(Assert.java:472)
	at org.junit.Assert.assertEquals(Assert.java:456)
	at ch.qos.logback.core.util.TimeUtilTest.testDay(TimeUtilTest.java:74)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:208)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:159)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:87)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:95)

testWeek(ch.qos.logback.core.util.TimeUtilTest)  Time elapsed: 0.003 sec  <<< FAILURE!
java.lang.AssertionError: expected:<1164596400000> but was:<1164592800000>
	at org.junit.Assert.fail(Assert.java:93)
	at org.junit.Assert.failNotEquals(Assert.java:647)
	at org.junit.Assert.assertEquals(Assert.java:128)
	at org.junit.Assert.assertEquals(Assert.java:472)
	at org.junit.Assert.assertEquals(Assert.java:456)
	at ch.qos.logback.core.util.TimeUtilTest.testWeek(TimeUtilTest.java:100)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:208)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:159)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:87)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:95)

testMonth(ch.qos.logback.core.util.TimeUtilTest)  Time elapsed: 0.005 sec  <<< FAILURE!
java.lang.AssertionError: expected:<1164942000000> but was:<1164938400000>
	at org.junit.Assert.fail(Assert.java:93)
	at org.junit.Assert.failNotEquals(Assert.java:647)
	at org.junit.Assert.assertEquals(Assert.java:128)
	at org.junit.Assert.assertEquals(Assert.java:472)
	at org.junit.Assert.assertEquals(Assert.java:456)
	at ch.qos.logback.core.util.TimeUtilTest.testMonth(TimeUtilTest.java:115)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:208)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:159)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:87)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:95)



More information about the Logback-user mailing list