{"id":21273508,"url":"https://github.com/graphaware/neo4j-logging-logstash-elk","last_synced_at":"2025-10-10T20:11:02.133Z","repository":{"id":69925658,"uuid":"81473991","full_name":"graphaware/neo4j-logging-logstash-elk","owner":"graphaware","description":null,"archived":false,"fork":false,"pushed_at":"2017-03-06T20:05:44.000Z","size":28,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-03-15T12:44:54.756Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/graphaware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-09T17:06:07.000Z","updated_at":"2025-03-11T11:21:33.000Z","dependencies_parsed_at":"2023-04-21T09:35:51.851Z","dependency_job_id":null,"html_url":"https://github.com/graphaware/neo4j-logging-logstash-elk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/graphaware/neo4j-logging-logstash-elk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fneo4j-logging-logstash-elk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fneo4j-logging-logstash-elk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fneo4j-logging-logstash-elk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fneo4j-logging-logstash-elk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graphaware","download_url":"https://codeload.github.com/graphaware/neo4j-logging-logstash-elk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fneo4j-logging-logstash-elk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005261,"owners_count":26083860,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-21T09:15:06.905Z","updated_at":"2025-10-10T20:11:02.128Z","avatar_url":"https://github.com/graphaware.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"neo4j-logging-logstash-elk\n=====================\n\nThe neo4j-logging-logstash-elk project provides a concrete implementation and documentation of how to configure [Neo4j](https://neo4j.com) to make use of [Logback](https://logback.qos.ch/) and [LogStash](https://www.elastic.co/products/logstash) to broadcast log statements to [ElasticSearch](https://www.elastic.co/)/[LogStash](https://www.elastic.co/products/logstash)/[Kibana](https://www.elastic.co/products/kibana) (ELK). \n\nThis implementation and configuration is performed at the Neo4j level, as opposed to configuring individual Neo4j module(s)/plugin(s), making the broadcasting of log statements to ELK available to all participating Neo4j modules/plugins. \n\nThese instructions have been tested using logstash-logback-encoder 4.8 and Neo4j Enterprise 3.0.6.\n\nMaking use of this project falls into three basic steps:\n\n1) [Building this project](#building-this-project)\n\n2) [Configure Neo4j](#configure-neo4j)\n\n3) [Update your code](#update-your-code)\n\n--------------------\n## Building This Project\n\nThe neo4j-logging-logstash-elk project builds an uber jar containing all of the transitive dependencies required for the logstash-logback-encoder to function. This uber jar is then placed into the $neo4j_home/plugins directory, seamlessly providing Neo4j with all of the dependencies in one deployment. \n\nTo build this project and deploy it to your Neo4j instance(s):\n```\ngit clone https://github.com/graphaware/neo4j-logging-logstash-elk\ncd neo4j-logging-logstash-elk\n\nmvn clean install\n\ncp target/neo4j-logging-logstash-elk-*.jar $neo4j_home/plugin\n```\n\n--------------------\n## Configure Neo4j\n\n\nNeo4j (or perhaps more accurately, Logback) must be configured to make use of the logstash-logback-encoder. To do this, copy either the example below or the logback.xml file contained within this project to your Neo4j's config directory and customize as needed.\n\nFor convenient reference, below is an example logback.xml that outputs log statements to the console, to a file located in $neo4j_home/logs/application.log, and broadcasts to ELK on **192.168.99.100:5000**. \n \n```\n\u003cconfiguration\u003e\n\n   \u003cappender name=\"STDOUT\" class=\"ch.qos.logback.core.ConsoleAppender\"\u003e\n      \u003cencoder\u003e\n         \u003cpattern\u003e%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n\u003c/pattern\u003e\t\t\n      \u003c/encoder\u003e      \n   \u003c/appender\u003e\n\n   \u003cappender name=\"FILE\" class=\"ch.qos.logback.core.FileAppender\"\u003e\n      \u003cfile\u003e../logs/application.log\u003c/file\u003e\n      \u003cappend\u003etrue\u003c/append\u003e\n      \u003cencoder\u003e\n         \u003cpattern\u003e%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n\u003c/pattern\u003e\n      \u003c/encoder\u003e\n   \u003c/appender\u003e\n\n   \u003cappender name=\"LOGSTASH\" class=\"net.logstash.logback.appender.LogstashTcpSocketAppender\"\u003e\n\n         \u003cdestination\u003e192.168.99.100:5000\u003c/destination\u003e\n          \u003ckeepAliveDuration\u003e5 minutes\u003c/keepAliveDuration\u003e\n\n         \u003cencoder class=\"net.logstash.logback.encoder.LogstashEncoder\"\u003e\n         \u003c/encoder\u003e\n\n   \u003c/appender\u003e\n\n   \u003croot level=\"info\"\u003e          \n         \u003cappender-ref ref=\"STDOUT\" /\u003e\n         \u003cappender-ref ref=\"FILE\" /\u003e\n         \u003cappender-ref ref=\"LOGSTASH\" /\u003e\n   \u003c/root\u003e\n\n   \u003clogger name=\"com.graphaware\" level=\"DEBUG\"\u003e\n         \u003cappender-ref ref=\"STDOUT\" /\u003e\n         \u003cappender-ref ref=\"FILE\" /\u003e\n         \u003cappender-ref ref=\"stash\" /\u003e\n   \u003c/logger\u003e\n\n\u003c/configuration\u003e\n```\n\nHaving performed the steps above to build the project, simply copy the above sample into $neo4j_home/config/logback.xml and restart Neo4j.\n\n--------------------\n\n## Update Your Code\n\nIn order for the logstash-logback-encoder to broadcast to ELK, the [SLF4j](https://www.slf4j.org) logging framework must be used rather than GraphAware's typically used org.neo4j.logging.Log, com.graphaware.common.log.LoggerFactory, or org.neo4j.logging.LogProvider classes.\n\nThis means that for your log statements to be broadcast to ELK your project **must** use:\n\u003cpre\u003e\u003cb\u003e\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\u003c/b\u003e\n...\nprivate static final Logger LOG = LoggerFactory.getLogger(Example.class);\n\u003c/pre\u003e\nrather than\n```\nimport import org.neo4j.logging.Log;\nimport com.graphaware.common.log.LoggerFactory;\n...\nprivate static final Log LOG = LoggerFactory.getLogger(Example.class);\n```\nAfter performing the above code updates as well as following all sections of this document, rebuild and redeploy your Neo4j module/plugin and restart Neo4j. You will now see log statements appear in your console, the $neo4j_home/log/application.log, and within your running ELK instance available at [http://192.168.99.100:5601](http://192.168.99.100:5601).  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphaware%2Fneo4j-logging-logstash-elk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraphaware%2Fneo4j-logging-logstash-elk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphaware%2Fneo4j-logging-logstash-elk/lists"}