Discussion:
Debug logging in Maven project
Markus Jelsma
2017-01-10 10:55:12 UTC
Permalink
Hello,

I used to enable debug logging in my Maven project's unit tests by just setting log4j's global level to DEBUG, very handy, especially in debugging some Solr Cloud start up issues. Since a while, not sure to long, i don't seem to be able to get any logging at all. This project depends on 6.3. Anyone here that can tell me how to get something so simple but so helpful back to work?

Many thanks,
Markus

$ cat src/test/resources/log4j.properties
log4j.rootLogger=debug,info,stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
Pushkar Raste
2017-01-10 13:52:40 UTC
Permalink
Seems like you have enabled only console appender. I remember there was a
changed made to disable console appender if Solr is started in background
mode.
Post by Markus Jelsma
Hello,
I used to enable debug logging in my Maven project's unit tests by just
setting log4j's global level to DEBUG, very handy, especially in debugging
some Solr Cloud start up issues. Since a while, not sure to long, i don't
seem to be able to get any logging at all. This project depends on 6.3.
Anyone here that can tell me how to get something so simple but so helpful
back to work?
Many thanks,
Markus
$ cat src/test/resources/log4j.properties
log4j.rootLogger=debug,info,stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
Markus Jelsma
2017-01-10 14:10:28 UTC
Permalink
Indeed, there were some changes recently but i also can't get logging to work on older versions such as 6.0.

Thanks,
Markus



-----Original message-----
Sent: Tuesday 10th January 2017 14:53
Subject: Re: Debug logging in Maven project
Seems like you have enabled only console appender. I remember there was a
changed made to disable console appender if Solr is started in background
mode.
Post by Markus Jelsma
Hello,
I used to enable debug logging in my Maven project's unit tests by just
setting log4j's global level to DEBUG, very handy, especially in debugging
some Solr Cloud start up issues. Since a while, not sure to long, i don't
seem to be able to get any logging at all. This project depends on 6.3.
Anyone here that can tell me how to get something so simple but so helpful
back to work?
Many thanks,
Markus
$ cat src/test/resources/log4j.properties
log4j.rootLogger=debug,info,stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
Markus Jelsma
2017-01-10 14:23:55 UTC
Permalink
Ahá, i am stupid indeed. I forgot i also had to change slf4j-nop to slf4j-simple in my pom.xml..

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <version>1.7.21</version>
      <scope>test</scope>
    </dependency>

Sorry for the noise!

Markus



-----Original message-----
Sent: Tuesday 10th January 2017 15:10
Subject: RE: Debug logging in Maven project
Indeed, there were some changes recently but i also can't get logging to work on older versions such as 6.0.
Thanks,
Markus
 
 
-----Original message-----
Sent: Tuesday 10th January 2017 14:53
Subject: Re: Debug logging in Maven project
Seems like you have enabled only console appender. I remember there was a
changed made to disable console appender if Solr is started in background
mode.
Post by Markus Jelsma
Hello,
I used to enable debug logging in my Maven project's unit tests by just
setting log4j's global level to DEBUG, very handy, especially in debugging
some Solr Cloud start up issues. Since a while, not sure to long, i don't
seem to be able to get any logging at all. This project depends on 6.3.
Anyone here that can tell me how to get something so simple but so helpful
back to work?
Many thanks,
Markus
$ cat src/test/resources/log4j.properties
log4j.rootLogger=debug,info,stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
Loading...