1

So I've been developing a GraphAware Runtime module to extend Neo4J functionality. According to GraphAware, in order to enable logging I need to add a slf4j provided dependency to my module and add an entry to custom-logback.xml file.

That unfortunately doesn't seem to work. Specifying custom log levels doesn't seem to affect what is being printed in the console, and adding a new appender (file) doesn't seem to take any effect, i.e. no files are created.

Did anyone have a go at adding logs to graphaware runtime modules? Also, how would one debug such a module, if you have to deploy it to neo4j, and it's being run by the neo4j itself?

UPDATE 1:

So I'm using Neo4J 2.3.2 and the custom-logback.xml file didn't exist orignally in the package, and I had to create it. I just checked and downloaded 2.2.8 version, and that file seems to exist in that package. Did anything change in the 2.3 version of Neo4J in terms of logging?

travikk
  • 87
  • 7

1 Answers1

1

Turns out adding a logback.xml file to your conf directory with contents along these lines seems to work perfectly. I'll update the docs, please let me know if that worked. Cheers!

<configuration>    
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSSZ} %-5level %msg%n</pattern>
        </encoder>
    </appender>

    <logger name="com.graphaware" level="INFO"/>

    <root level="DEBUG">
        <appender-ref ref="STDOUT"/>
    </root>
</configuration>
Michal Bachman
  • 2,661
  • 17
  • 22
  • Yes, that works perfectly. Thanks a lot! Any reason for that change? It breaks compatibility and for anybody upgrading from 2.2 this will not be obvious and potentially will cause a lot of headache :) – travikk Jan 27 '16 at 09:49
  • Not sure myself to be honest - I just found this quick fix without having time to dig deep into the causes. Will do though and report back. Glad it works! – Michal Bachman Jan 27 '16 at 16:37