Red Hat Bugzilla – Bug 963778
Value of the handler.FILE.fileName property in logging.properties changed after first launch
Last modified: 2014-10-25 08:01:35 EDT
The default value of the handler.FILE.fileName property in standalone/configuraion is changed after first launch.
The default value is:
After first launch, the value is replaced by absolute path of the referenced log file. e.g.
This might cause issues if the server is moved to another directory and the original location is made unaccessible.
Caused by: java.io.FileNotFoundException: /home/dpospisi/runtimes/jpp-6.1-prod-prev/jboss-jpp-6.1/standalone/log/server.log (No such file or directory)
at java.io.FileOutputStream.open(Native Method)
We had some discussions around this before the freeze. I had a PR that did write out expressions back to the logging.properties, but there were some issues with and we didn't have time to work them all out and test them.
There is still an outstanding JIRA for this as well, https://issues.jboss.org/browse/WFLY-234.
James Perkins <email@example.com> made a comment on jira WFLY-234
Main issue with writing expressions is system properties, at least as defined in the XML configurations, aren't available at the time they are needed to resolve the expressions.
Voting for a fix on this bug short term. Numerous customers in my patch expect and need the JBoss server installation to be self-contained, and to be portable to different directories. Issues like this break that functionality with EAP as well as layer products.
We more customers build cloud automation with differing strategies this expectation that our product is more portable is a key part of the 'cloud readiness' value proposition.
I've update the JIRA to target WildFly 9. When complete we can backport to EAP 6.x. Whether or no it makes 6.3 is up in the air really. Off the top of my head I don't see it being a huge issue, but it's been quite a while since I've looked at it.
Copying the comment from the WF JIRA:
I started experimenting with and I just can't find a decent workaround for the system property resolution.
We'll just assume the default settings of jboss.server.log.dir for the relative-to and server.log for the path. In the logging.properties file it would look something like:
The issue is the system property jboss.server.log.dir is not set before the log manager is configured. This property is generally set during the main entry point of the server and the log manager is configured in the main entry point of jboss-modules. The only way this would work is if the value for the relative-to was also set in the JAVA_OPTS.
More over setting a custom path the user would have to add the path to the JAVA_OPTS as well. I can't see a way to resolve which path is being used by the time the log manager is configured. While just using a relative-to path is an example, the same would be true for any property.
This will not be done for EAP 6. As the previous comment states there are issues around setting system properties for the log manager as it's one of the first things configured. If an issue is filed for a feature request for EAP 7 it would definitely be considered.