Hey Manna, Thanks for your quick reply. You're right - log4j JAR was not on my classpath...I would've thought IntelliJ was smart enough to add the external libraries to the classpath.
I have a workaround at the moment - I eventually decided to run ./gradlew releaseTarGazAll, untar it, and then add the libs/ directory as a library in IntelliJ IDEA. Then logging actually works because it can find the log4j JAR!! I'm new to gradle, but just wondering what did you mean by KAFKA_HOME/libs folder? That folder doesn't exist in the repository, unless there's a specific gradle task I can run to just create the libs/ directory and populate it with the right JARs? I had a look through the build.gradle file but am presently still confused. Lerh On 23 May 2018 at 16:29, M. Manna <manme...@gmail.com> wrote: > I have managed to load the broker from within Eclipse Scala IDE. I only > needed to put server.properties and -Dlog4j.configuration in program > arguments area. > > How did you set up classpath? You need to set up classpath such that it can > find all the jars necessary. And you shouldn’t have to remove any jar. For > simplicity, could you r move everything and keep the jars which are only > found under your KAFKA_HOME/libs folder? And try again. > > Regards, > > > > On Wed, 23 May 2018 at 07:11, Lerh Chuan Low <l...@instaclustr.com> wrote: > > > Hi Kafka devs, > > > > I've been trying to debug Kafka locally. I've been following the guides > > available on the website/confluence, which are: > > > > - Installing gradle (already have Java and Scala) > > - git clone kafka > > - cd git repository > > - gradle > > - ./gradlew idea > > > > I then open IntellIJ IDEA and open the kafka repository. It works! The > > only problem is that it refuses to log anything. > > > > > > > > I have verified that Log4j JAR is in the classpath > > > > > > > > In this case I've purposely removed log4j12:1.7.21 because some > > Stackoverflow answers suggested using 1 and only 1 logging framework JAR. > > It still outputs the same error message. > > > > I also tried to specify the configurationFile explicitly using > > -Dlog4j.configurationFile=config/log4j.properties (even though Log4J > should > > default to an Appender otherwise), it didn't work still (which is to be > > expected I guess since SLF4J can't even find the Log4J implementation). > > > > Not sure if anyone has any ideas or ran into this issue when running > Kafka > > from IntelliJ locally? I've been stuck on it for quite some time. If I > > debug and check LoggerFactory#findPossibleStaticLoggerBinderPathSet(), > it's > > not able to find the SLF4J implementation. Is there anything else I need > to > > setup, or does Kafka log somewhere else? > > > > Thanks!! > > > > Lerh > > > > >