Repository navigation
Native: write the engine log to the per-user log directory, never the working directory - #70
Merged
Merged
Conversation
… working directory The native library opened ./log/arcadedb.log in the current working directory. The loader now creates the log directory (ARCADEDB_LOG_DIR, else the state directory, like the JVM build), writes logging.properties there and passes arcadedb.server.logsDirectory and java.util.logging.config.file as isolate arguments, which are in place before the engine's first log call. A user's own isolate argument wins. The log-directory logic moves from jvm.py to _logdir.py so both builds share it. Tests: the subprocess tests of test_log_dir.py run on both builds, test_native_log_dir.py covers the isolate-argument paths, and a JVM-side test compares the native copy of the engine's log settings with the engine jar. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
tae898
marked this pull request as ready for review
October 25, 2026 12:26
…name, parity setuptools) into native-log-dir Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tae898
added a commit
that referenced
this pull request
Oct 25, 2026
…) into native-ci-python-versions Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tae898
added a commit
that referenced
this pull request
Oct 25, 2026
…umnar-port Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #66 (base
native-two-dist). Draft, not for merge before #66.Problem
The native build writes
./log/arcadedb.loginto the current working directory, because the engine's bundledarcadedb-log.propertieshard-codes that pattern and nothing in the native loader overrides it. Strayarcadedb.log.*and.lckfiles appear wherever the process starts (the repository root after a test run). The JVM build already moves the log to a per-user directory (ARCADEDB_LOG_DIR, else the state directory) through two JVM arguments and a renderedlogging.properties, andtests/test_log_dir.pyhas 5 tests that failed on native.Change
No Java glue and no image rebuild are needed. A native-image isolate takes
-Dsystem properties as isolate arguments (the loader already passes-XX:ones fromARCADEDB_NATIVE_ISOLATE_ARGS), and they are in place before any Java code runs, so before the engine's first log call. Checked on an unmodified image: with-Darcadedb.server.logsDirectory=...and-Djava.util.logging.config.file=...as isolate arguments the log goes to the directory and./logis not created.src/arcadedb/_logdir.py(new, no JPype): the log-directory logic that was injvm.py(state directory by platform,ARCADEDB_LOG_DIR, temp-dir fallback, rendering oflogging.properties), now shared.jvm.pyimports it under its old names, so the JVM behaviour and its tests are unchanged.src/arcadedb/_native/lib.py: beforegraal_create_isolate, create the directory, writelogging.propertiesthere and add the two isolate arguments. An argument the user gave inARCADEDB_NATIVE_ISOLATE_ARGSwins, asjvm_argsdo on the JVM build.lib.LOG_DIR_USEDis the native counterpart ofjvm._LOG_DIR_USED._logdir.NATIVE_ENGINE_LOG_PROPERTIESis a copy of that file without its pattern line, andtest_native_engine_log_config_matches_the_engine_jar(JVM job, where the jar exists) fails when an engine upgrade changes the file.docs/modules/ROOT/pages/how-to/logs.adoc(new, in the nav): default locations,ARCADEDB_LOG_DIR, and how to set the two properties on each package.Tests
tests/test_log_dir.py: the child script is backend-neutral, so the default-location,ARCADEDB_LOG_DIRand unusable-directory tests now run on both builds (empty read-only working directory, log in the chosen directory, samelogging.propertiescontent). The two tests that need a JVM or the engine jar are inNATIVE_NA_JVM_TESTS. New unit tests for the isolate arguments and for the render of the native copy.tests/test_native_log_dir.py(native only):ARCADEDB_NATIVE_ISOLATE_ARGSmoves the log, and the user's own logging config file wins; the working directory stays empty in both.Run on the native image of the tip of #66 (glue unchanged, so no rebuild):
test_log_dir13 passed, 3 skipped as NA-JVM;test_native_log_dir2 passed;test_core,test_server,test_cypher,test_native_startup_runtime,test_native_xml_limitspass. The JVM-side tests that need no jars pass on the JVM backend, and the engine-jar comparison was checked by hand againstarcadedb-engine-26.10.2.jar(equal). The full JVM run oftest_log_dir.pyneeds the JVM wheel and has not been run locally; the JVM job runs it.🤖 Generated with Claude Code