Article DetailsDetailsHelp DetailsWhen installing Neo4j as a service, users may not find the neo4j.log in the <neo4j-home>\logs or /var/log/neo4j/ path they may be familiar with. Instead, the neo4j.log is by default written to the systemd journal when running as a service. For users not familiar with the systemd journal, the list of questions and answers below have been compiled to help. How do I view Neo4j logging in the journal? Users can view the Neo4j logging by utilizing the standard options of journalctl. The command sudo journalctl -u neo4j will filter the journal for only Neo4j entries. The sudo journalctl --help command can be used to view the many options journalctl provides but here are a few options that may be helpful to start. --utc specifies the logs in UTC time--since allows you to filter based on time (i.e. "yesterday", "2 hours ago", "2022-08-19 12:15:00" ) -r shows log entries in reverse order -n returns only 'n' number of entries How can I write the neo4j.log to another location? This behavior can be changed by setting the dbms.logs.user.stdout_enabled=false in which case, the neo4j.log will be written to the location defined in setting dbms.directories.logs. My journal files are too big, how can I reduce the journal log size? The journald logging is controlled independently of Neo4j and is control by the server's journald.conf configurations. Several sources, not only Neo4j, may log to the journal as it is a system wide service that collects logging data for installed services. Full settings are defined in man journald.conf but here are a couple of examples of how you can reduce the size of the journal on demand. --vacuum-time=TIME prune log entries older than a specified period of time--vacuum-size=BYTES prune log entries based on file size--vacuum-files=INT limit the number of journal files For example: sudo journalctl --vacuum-time=1week will remove archived journal entries older than 1 weeksudo journalctl --vacuum-size=200M will remove archived journal entries to ensure the log file meets the 200M size requirementsudo journalctl --vacuum-files=2 will limit the number of journal files to 2. NOTE: vacuum works on archived journal files. If the desire is to also remove from the active journal file, you will need to rotate the log first to archive. (i.e. sudo journalctl --rotate ) InformationTitleNeo4j Service Logging Tips Using journalctlArticle Created Date3/15/2024, 10:55 PMURL Name8908773708563-Neo4j-Service-Logging-Tips-Using-journalctlLast Modified Date3/18/2024, 6:15 AM