Skip to content

move derby.log to logs folder instead of install root - #488

Open
tonygermano wants to merge 1 commit into
OpenIntegrationEngine:mainfrom
tonygermano:engine-derby-log
Open

tonygermano wants to merge 1 commit into
OpenIntegrationEngine:mainfrom
tonygermano:engine-derby-log

Conversation

@tonygermano

@tonygermano tonygermano commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

By default, this file is created in the JVM working directory.

Release Note

Update conf/base_includes.vmoptions to set the derby log path to logs/

When using Derby, the derby.log file is created in the oie install folder by default. The base_includes.vmoptions file now sets the derby.stream.error.file system property to use the same logs/ folder used by default by log4j. The value can be overridden in custom.vmoptions to choose a different path. The destination directory must already exist.

@mgaffigan

Copy link
Copy Markdown
Contributor

Can this be actively set from code? This is presumably CWD dependent - we should be reducing our CWD dependency, not increasing.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Test Results

  147 files  ±0    147 suites  ±0   4m 19s ⏱️ + 1m 3s
1 008 tests ±0  1 008 ✅ ±0  0 💤 ±0  0 ❌ ±0 
1 332 runs  ±0  1 326 ✅ ±0  6 💤 ±0  0 ❌ ±0 

Results for commit 196a724. ± Comparison against base commit 75c52f6.

♻️ This comment has been updated with latest results.

@tonygermano

Copy link
Copy Markdown
Member Author

Can this be actively set from code? This is presumably CWD dependent - we should be reducing our CWD dependency, not increasing.

@mgaffigan I'm not sure. Can come back to this later, but I just wanted to get it documented so I didn't forget about it, and a 1-liner was just as easy as opening an issue. I'm guessing anything else will take more effort.

By default, this file is created in the JVM working directory.

Signed-off-by: Tony Germano <tony@germano.name>
@tonygermano

Copy link
Copy Markdown
Member Author

@mgaffigan After checking again, I think this is the appropriate place to set it. This is the property the library looks for. This location is easy to override or set as an absolute path in custom.vmoptions.

Recently rebased to resolve a merge conflict with #447

@tonygermano
tonygermano requested a review from NicoPiel November 29, 2026 18:23

@mgaffigan mgaffigan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would still prefer a CWD insensitive setting (e.g.: set the property from code).

@tonygermano

Copy link
Copy Markdown
Member Author

@mgaffigan I'm not sure if I understand what you mean by CWD insensitive. The system property can be set to an absolute or relative pathname. I just have it defaulted to the same location that the log4j default uses. What would it look like to set the property from code? And is it worth adding code to handle this if we end up removing derby in the near future?

@mgaffigan

Copy link
Copy Markdown
Contributor

CWD insensitive refers to the property of each unit of software having the same behavior regardless of the system current working directory. Since this would presumably produce different results based on which directory, it would be cwd sensitive. CWD insensitive behavior would be to make the property relative to the config file or to the application directory, or to throw on other than an absolute path.

I would presume setting it from code would be:

var logPath = StringUtils.defaultIfEmpty(System.getProperty("derby.stream.error.file"), "logs/derby.log");
System.setProperty("derby.stream.error.file", appRoot.resolve(Path.of(logPath)).toString());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants