Hi Tomasz,<div><br></div><div><span class="Apple-style-span" style="border-collapse:collapse;color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px">>The only issue I see is integration testing: at least my tests require running MongoDB </span></div>
<div><span class="Apple-style-span" style="border-collapse:collapse;color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px">>instance somewhere. This is a major drawback for both continuous integration of Lobgack </span></div>
<div><span class="Apple-style-span" style="border-collapse:collapse;color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px">>extensions and for all developers, not necessarily interested in this particular extension.</span></div>
<div><font class="Apple-style-span" color="#222222" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse:collapse"><br></span></font>I think we should not require for unit test a mongodb instance. I have very good experience with jmockit <a href="http://code.google.com/p/jmockit/">http://code.google.com/p/jmockit/</a> what do you think about?</div>
<div><br></div><div>Christian</div><div><br><div class="gmail_quote">2012/6/14 Tomasz Nurkiewicz <span dir="ltr"><<a href="mailto:nurkiewicz@gmail.com" target="_blank">nurkiewicz@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Here is precisely what I created so far:<br>
<br>
* base abstract appender handling MongoDB connectivity [1]<br>
* standard appender [2] + tests [3]<br>
* access appender (tested with Tomcat) [4] + tests [5]<br>
* configuration examples [6]<br>
<br>
By quick googling I found several other community implementations: [7], [8], [9]. Looks like my implementation is the only one capable of storing access logs as well, e.g.:<br>
<br>
{<br>
"_id" : ObjectId("<u></u>4d98cc4f7abb95e59279e183"),<br>
"timeStamp" : ISODate("2011-04-03T19:36:47.<u></u>339Z"),<br>
"server" : "localhost",<br>
"remote" : {<br>
"host" : "0:0:0:0:0:0:0:1",<br>
"user" : "tomcat",<br>
"addr" : "0:0:0:0:0:0:0:1"<br>
},<br>
"request" : {<br>
"uri" : "/manager/images/tomcat.gif",<br>
"protocol" : "HTTP/1.1",<br>
"method" : "GET",<br>
"sessionId" : "<u></u>1C6357816D9EEFD31F6D9D154D8730<u></u>8A",<br>
"userAgent" : "Mozilla/5.0 (X11; U; Linux i686; pl-PL; rv:1.9.2.16) Gecko/20110323 Ubuntu/10.10 (maverick) Firefox/3.6.16",<br>
"referer" : "<a href="http://localhost:8080/manager/html" target="_blank">http://localhost:8080/<u></u>manager/html</a>"<br>
},<br>
"response" : {<br>
"contentLength" : NumberLong(1934),<br>
"statusCode" : 200<br>
}<br>
}<br>
<br>
We should now revise all available implementations and build final one based on best ideas from all of them. The only issue I see is integration testing: at least my tests require running MongoDB instance somewhere. This is a major drawback for both continuous integration of Lobgack extensions and for all developers, not necessarily interested in this particular extension.<br>
<br>
Christian Trutz - thanks for creating the project structure.<br>
<br>
[1]: <a href="https://github.com/nurkiewicz/logback/blob/mongodb-appender/logback-core/src/main/java/ch/qos/logback/core/db/mongo/MongoDBAppenderBase.java" target="_blank">https://github.com/nurkiewicz/<u></u>logback/blob/mongodb-appender/<u></u>logback-core/src/main/java/ch/<u></u>qos/logback/core/db/mongo/<u></u>MongoDBAppenderBase.java</a><br>
<br>
[2]: <a href="https://github.com/nurkiewicz/logback/blob/mongodb-appender/logback-classic/src/main/java/ch/qos/logback/classic/db/mongo/MongoDBAppender.java" target="_blank">https://github.com/nurkiewicz/<u></u>logback/blob/mongodb-appender/<u></u>logback-classic/src/main/java/<u></u>ch/qos/logback/classic/db/<u></u>mongo/MongoDBAppender.java</a><br>
<br>
[3]: <a href="https://github.com/nurkiewicz/logback/blob/mongodb-appender/logback-classic/src/test/java/ch/qos/logback/classic/db/mongo/MongoDBAppenderTest.java" target="_blank">https://github.com/nurkiewicz/<u></u>logback/blob/mongodb-appender/<u></u>logback-classic/src/test/java/<u></u>ch/qos/logback/classic/db/<u></u>mongo/MongoDBAppenderTest.java</a><br>
<br>
[4]: <a href="https://github.com/nurkiewicz/logback/blob/mongodb-appender/logback-access/src/main/java/ch/qos/logback/access/db/mongo/MongoDBAppender.java" target="_blank">https://github.com/nurkiewicz/<u></u>logback/blob/mongodb-appender/<u></u>logback-access/src/main/java/<u></u>ch/qos/logback/access/db/<u></u>mongo/MongoDBAppender.java</a><br>
<br>
[5]: <a href="https://github.com/nurkiewicz/logback/blob/mongodb-appender/logback-access/src/test/java/ch/qos/logback/access/db/mongo/MongoDBAppenderTest.java" target="_blank">https://github.com/nurkiewicz/<u></u>logback/blob/mongodb-appender/<u></u>logback-access/src/test/java/<u></u>ch/qos/logback/access/db/<u></u>mongo/MongoDBAppenderTest.java</a><br>
<br>
[6]: <a href="https://github.com/nurkiewicz/logback/tree/mongodb-appender/logback-classic/src/test/input/joran/mongodb" target="_blank">https://github.com/nurkiewicz/<u></u>logback/tree/mongodb-appender/<u></u>logback-classic/src/test/<u></u>input/joran/mongodb</a><br>
<br>
[7]: <a href="https://github.com/kofemann/mongo-appender-for-logback" target="_blank">https://github.com/kofemann/<u></u>mongo-appender-for-logback</a><br>
<br>
[8]: <a href="https://github.com/smilebase/logback-mongodb" target="_blank">https://github.com/smilebase/<u></u>logback-mongodb</a><br>
<br>
[9]: <a href="https://github.com/uded/logback-mongodb-appender" target="_blank">https://github.com/uded/<u></u>logback-mongodb-appender</a><div class="im HOEnZb"><br>
<br>
<br>
On 14.06.2012 14:24, ceki wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Christian,<br>
<br>
Tomasz created a jira issue for implementing MongoDBAppender [2]. His<br>
implementation can be found at [3, 4, 5].<br>
<br>
I think his impl is worth a look. He seprated connection functionality<br>
into MongoDBAppenderBase (part of logback-core) and ILoggingEvent<br>
specific code into MongoDBAppender (in logback-classic). Moreover, his<br>
code comes with 100% test coverage!<br>
<br>
I guess the code could be easily extended to cater for AccessEvent (in<br>
logback-access).<br>
<br>
Anyway, let me know what I can do to move this work forward.<br>
<br>
[1] <a href="https://github.com/qos-ch/logback-extensions" target="_blank">https://github.com/qos-ch/<u></u>logback-extensions</a><br>
[2] <a href="http://jira.qos.ch/browse/LOGBACK-522" target="_blank">http://jira.qos.ch/browse/<u></u>LOGBACK-522</a><br>
[3] <a href="https://github.com/nurkiewicz/logback/tree/mongodb-appender" target="_blank">https://github.com/nurkiewicz/<u></u>logback/tree/mongodb-appender</a><br>
[4] <a href="https://github.com/nurkiewicz/logback/commit/858aceb9af74d0" target="_blank">https://github.com/nurkiewicz/<u></u>logback/commit/858aceb9af74d0</a><br>
[5] <a href="https://github.com/nurkiewicz/logback/commit/f5bff8e43" target="_blank">https://github.com/nurkiewicz/<u></u>logback/commit/f5bff8e43</a><br>
<br>
</blockquote>
<br>
<br>
<br></div><div class="im HOEnZb">
pozdrowienia<br>
<br>
-- <br>
Tomasz Nurkiewicz<br>
<a href="http://nurkiewicz.blogspot.com" target="_blank">http://nurkiewicz.blogspot.com</a><br></div><div class="HOEnZb"><div class="h5">
______________________________<u></u>_________________<br>
logback-dev mailing list<br>
<a href="mailto:logback-dev@qos.ch" target="_blank">logback-dev@qos.ch</a><br>
<a href="http://mailman.qos.ch/mailman/listinfo/logback-dev" target="_blank">http://mailman.qos.ch/mailman/<u></u>listinfo/logback-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Christian Trutz<br>Von-Flotow-Straße 24<br>D-45772 Marl<br><br>Festnetz (privat): +49 (0)2365 3840327<br>E-Mail: <a href="mailto:christian.trutz@gmail.com" target="_blank">christian.trutz@gmail.com</a><div>
<br></div><br>
</div>