You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Matt Sicker <bo...@gmail.com> on 2014/04/29 00:49:04 UTC

Splitting off NoSQL to its own module.

After some basic discussion about this, I'm going to split off the NoSQL
code into a module called "log4j-nosql". This is where the Mongo and Couch
plugins are right now, and it looks like we'll be adding a Solr one soon
most likely along with that Gora one.

Anyway, I split it out last night but didn't get a chance to test it out
until just now. All tests still pass, so I'm going to commit it. If there
are any objections, I can roll back this commit.

-- 
Matt Sicker <bo...@gmail.com>

Re: Splitting off NoSQL to its own module.

Posted by Ralph Goers <ra...@dslextreme.com>.
Do you have the new nosql jar in your classpath?  

Ralph

On May 5, 2014, at 8:15 AM, Markus Klose <lo...@markus-klose.de> wrote:

> Hi,
>  
> since you moved the nosql appender into a separate module some of my other test are failing.
>  
> I have a test that reads a log4j.xml, getting a specific logger and getting all appenders of that specific logger.
> but now this test does not have any (nosql) appender anymore
>  
>  
> in my output i have seen the following line
> 2014-05-05 17:02:38,127 DEBUG Found Plugin Map at file:/C:/Users/mk/git/logging-log4j2/log4j-core/target/classes/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat
>  
> Log4j2Plugins.dat does not contain any nosql stuff.
> Could this file be realted to my problem? Do i need to change the log4j.xml to cache that appender as well?
>  
>  
>  
> below you will find the log4j.xml I am using.
>  
> <?xml version="1.0" encoding="UTF-8"?> 
> <Configuration status="DEBUG"> 
>   <Appenders> 
>     <Console name="Console" target="SYSTEM_OUT"> 
>       <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/> 
>     </Console> 
> 
>      <NoSql name="HttpSolrServerAppender"> 
>         <Solr url="http://localhost:8983/solr" commitWithinMs="1000"/> 
>      </NoSql> 
>       
>     <NoSql name="databaseAppender"> 
>         <MongoDb collectionName="applicationLog" factoryClassName="org.example.db.ConnectionFactory" 
>             factoryMethodName="getNewMongoClient" /> 
>     </NoSql> 
>          
>   </Appenders> 
>   <Loggers> 
>     <Root level="DEBUG"> 
>       <AppenderRef ref="Console" level="DEBUG"/> 
>     </Root> 
>     <Logger name="HttpSolrServer" level="DEBUG"> 
>         <AppenderRef ref="HttpSolrServerAppender"/> 
>         <AppenderRef ref="databaseAppender"/> 
>     </Logger>     
>   </Loggers> 
> </Configuration>
>  
>  
>> Matt Sicker <bo...@gmail.com> hat am 4. Mai 2014 um 18:38 geschrieben: 
>> 
>> Good point. I'm renaming it to org.apache.logging.log4j.nosql.appender. Committed in r1592377.
>> 
>> 
>> On 4 May 2014 03:07, Markus Klose <lo...@markus-klose.de> wrote: 
>> does it makes sense to refactorr the package wihtin the module "log4-nosql"  as well
>>  
>> actually the package is still "org.apache.logging.log4j.core.appender" but its not core anymore
>>  
>> Markus
>>  
>>> Matt Sicker < boards@gmail.com> hat am 29. April 2014 um 00:49 geschrieben: 
>>> 
>>> After some basic discussion about this, I'm going to split off the NoSQL code into a module called "log4j-nosql". This is where the Mongo and Couch plugins are right now, and it looks like we'll be adding a Solr one soon most likely along with that Gora one.
>>>  
>>> Anyway, I split it out last night but didn't get a chance to test it out until just now. All tests still pass, so I'm going to commit it. If there are any objections, I can roll back this commit. 
>>>  
>>> -- 
>>> Matt Sicker < boards@gmail.com>
>> 
>>  
>> 
>> 
>>  
>> -- 
>> Matt Sicker < boards@gmail.com>
> 
>  


Re: Splitting off NoSQL to its own module.

Posted by Matt Sicker <bo...@gmail.com>.
You are adding log4j-nosql to your deployment or classpath, right? When
log4j-nosql is compiled, the Log4j2plugins.dat file is created by an
annotation processor. In a typical environment, the classpath is scanned
for all the resource files with the correct name and path. Are you getting
any relevant status log output for the plugins?


On 5 May 2014 10:15, Markus Klose <lo...@markus-klose.de> wrote:

>   Hi,
>
>  since you moved the nosql appender into a separate module some of my
> other test are failing.
>
>  I have a test that reads a log4j.xml, getting a specific logger and
> getting all appenders of that specific logger.
>  but now this test does not have any (nosql) appender anymore
>
>
>  in my output i have seen the following line
>  2014-05-05 17:02:38,127 DEBUG Found Plugin Map at
> file:/C:/Users/mk/git/logging-log4j2/log4j-core/target/classes/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat
>
>
>  Log4j2Plugins.dat does not contain any nosql stuff.
>  Could this file be realted to my problem? Do i need to change the
> log4j.xml to cache that appender as well?
>
>
>
>  below you will find the log4j.xml I am using.
>
>  <?xml version="1.0" encoding="UTF-8"?>
> <Configuration status="DEBUG">
>   <Appenders>
>     <Console name="Console" target="SYSTEM_OUT">
>       <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} -
> %msg%n"/>
>     </Console>
>
>      <NoSql name="HttpSolrServerAppender">
>         <Solr url="http://localhost:8983/solr" commitWithinMs="1000"/>
>      </NoSql>
>
>     <NoSql name="databaseAppender">
>         <MongoDb collectionName="applicationLog"
> factoryClassName="org.example.db.ConnectionFactory"
>             factoryMethodName="getNewMongoClient" />
>     </NoSql>
>
>   </Appenders>
>   <Loggers>
>     <Root level="DEBUG">
>       <AppenderRef ref="Console" level="DEBUG"/>
>     </Root>
>     <Logger name="HttpSolrServer" level="DEBUG">
>         <AppenderRef ref="HttpSolrServerAppender"/>
>         <AppenderRef ref="databaseAppender"/>
>     </Logger>
>   </Loggers>
> </Configuration>
>
>
>
> Matt Sicker <bo...@gmail.com> hat am 4. Mai 2014 um 18:38 geschrieben:
>
>  Good point. I'm renaming it to org.apache.logging.log4j.nosql.appender.
> Committed in r1592377.
>
>
>  On 4 May 2014 03:07, Markus Klose <lo...@markus-klose.de> wrote:
>
>   does it makes sense to refactorr the package wihtin the module
> "log4-nosql"  as well
>
>  actually the package is still "org.apache.logging.log4j.core.appender"
> but its not core anymore
>
>  Markus
>
>
> Matt Sicker < boards@gmail.com> hat am 29. April 2014 um 00:49
> geschrieben:
>
>  After some basic discussion about this, I'm going to split off the NoSQL
> code into a module called "log4j-nosql". This is where the Mongo and Couch
> plugins are right now, and it looks like we'll be adding a Solr one soon
> most likely along with that Gora one.
>
>  Anyway, I split it out last night but didn't get a chance to test it out
> until just now. All tests still pass, so I'm going to commit it. If there
> are any objections, I can roll back this commit.
>
> --
> Matt Sicker < boards@gmail.com>
>
>
>
>
>
>
>
> --
> Matt Sicker < boards@gmail.com>
>
>
>
>



-- 
Matt Sicker <bo...@gmail.com>

Re: Splitting off NoSQL to its own module.

Posted by Markus Klose <lo...@markus-klose.de>.
Hi,

since you moved the nosql appender into a separate module some of my other test
are failing.

I have a test that reads a log4j.xml, getting a specific logger and getting all
appenders of that specific logger.
but now this test does not have any (nosql) appender anymore


in my output i have seen the following line
2014-05-05 17:02:38,127 DEBUG Found Plugin Map at
file:/C:/Users/mk/git/logging-log4j2/log4j-core/target/classes/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat

Log4j2Plugins.dat does not contain any nosql stuff.
Could this file be realted to my problem? Do i need to change the log4j.xml to
cache that appender as well?



below you will find the log4j.xml I am using.

<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="DEBUG">
  <Appenders>
    <Console name="Console" target="SYSTEM_OUT">
      <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} -
%msg%n"/>
    </Console>

     <NoSql name="HttpSolrServerAppender">
        <Solr url="http://localhost:8983/solr" commitWithinMs="1000"/>
     </NoSql>

    <NoSql name="databaseAppender">
        <MongoDb collectionName="applicationLog"
factoryClassName="org.example.db.ConnectionFactory"
            factoryMethodName="getNewMongoClient" />
    </NoSql>

  </Appenders>
  <Loggers>
    <Root level="DEBUG">
      <AppenderRef ref="Console" level="DEBUG"/>
    </Root>
    <Logger name="HttpSolrServer" level="DEBUG">
        <AppenderRef ref="HttpSolrServerAppender"/>
        <AppenderRef ref="databaseAppender"/>
    </Logger>
  </Loggers>
</Configuration>



> Matt Sicker <bo...@gmail.com> hat am 4. Mai 2014 um 18:38 geschrieben:
> 
>  Good point. I'm renaming it to org.apache.logging.log4j.nosql.appender.
> Committed in r1592377.
> 
> 
>  On 4 May 2014 03:07, Markus Klose <log4j@markus-klose.de
> <ma...@markus-klose.de> > wrote:
>    > >    does it makes sense to refactorr the package wihtin the module
>    > > "log4-nosql"  as well
> > 
> >    actually the package is still "org.apache.logging.log4j.core.appender"
> > but its not core anymore
> > 
> >    Markus
> > 
> > 
> >     > > > Matt Sicker < boards@gmail.com <ma...@gmail.com> > hat am
> >     > > > 29. April 2014 um 00:49 geschrieben:
> > > 
> > >     After some basic discussion about this, I'm going to split off the
> > > NoSQL code into a module called "log4j-nosql". This is where the Mongo and
> > > Couch plugins are right now, and it looks like we'll be adding a Solr one
> > > soon most likely along with that Gora one.
> > > 
> > >     Anyway, I split it out last night but didn't get a chance to test it
> > > out until just now. All tests still pass, so I'm going to commit it. If
> > > there are any objections, I can roll back this commit.
> > > 
> > >     --
> > >     Matt Sicker < boards@gmail.com <ma...@gmail.com> >
> > > 
> > >    > > 
> > 
> >  > 
> 
> 
>  --
>  Matt Sicker < boards@gmail.com <ma...@gmail.com> >
> 


Re: Splitting off NoSQL to its own module.

Posted by Matt Sicker <bo...@gmail.com>.
Good point. I'm renaming it to org.apache.logging.log4j.nosql.appender.
Committed in r1592377.


On 4 May 2014 03:07, Markus Klose <lo...@markus-klose.de> wrote:

>   does it makes sense to refactorr the package wihtin the module
> "log4-nosql"  as well
>
>  actually the package is still "org.apache.logging.log4j.core.appender"
> but its not core anymore
>
>  Markus
>
>
> Matt Sicker <bo...@gmail.com> hat am 29. April 2014 um 00:49
> geschrieben:
>
>  After some basic discussion about this, I'm going to split off the NoSQL
> code into a module called "log4j-nosql". This is where the Mongo and Couch
> plugins are right now, and it looks like we'll be adding a Solr one soon
> most likely along with that Gora one.
>
>  Anyway, I split it out last night but didn't get a chance to test it out
> until just now. All tests still pass, so I'm going to commit it. If there
> are any objections, I can roll back this commit.
>
> --
> Matt Sicker < boards@gmail.com>
>
>
>
>



-- 
Matt Sicker <bo...@gmail.com>

Re: Splitting off NoSQL to its own module.

Posted by Markus Klose <lo...@markus-klose.de>.
does it makes sense to refactorr the package wihtin the module "log4-nosql"  as
well

actually the package is still "org.apache.logging.log4j.core.appender" but its
not core anymore

Markus


> Matt Sicker <bo...@gmail.com> hat am 29. April 2014 um 00:49 geschrieben:
> 
>  After some basic discussion about this, I'm going to split off the NoSQL code
> into a module called "log4j-nosql". This is where the Mongo and Couch plugins
> are right now, and it looks like we'll be adding a Solr one soon most likely
> along with that Gora one.
> 
>  Anyway, I split it out last night but didn't get a chance to test it out
> until just now. All tests still pass, so I'm going to commit it. If there are
> any objections, I can roll back this commit.
> 
>  --
>  Matt Sicker < boards@gmail.com <ma...@gmail.com> >
>