Bug 963778 - Value of the handler.FILE.fileName property in logging.properties changed after first launch
Value of the handler.FILE.fileName property in logging.properties changed aft...
Status: CLOSED WONTFIX
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Logging (Show other bugs)
6.1.0
Unspecified Unspecified
unspecified Severity high
: ---
: ---
Assigned To: James Perkins
Nikoleta Ziakova
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-16 10:27 EDT by Dominik Pospisil
Modified: 2014-10-25 08:01 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-09-16 11:46:08 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Bugzilla 900953 None None None Never
JBoss Issue Tracker WFLY-234 Optional Open Write expressions to logging.properties configuration file 2016-02-23 20:34 EST

  None (edit)
Description Dominik Pospisil 2013-05-16 10:27:23 EDT
The default value of the handler.FILE.fileName property in standalone/configuraion is changed after first launch.

The default value is:
${org.jboss.boot.log.file:boot.log}

After first launch, the value is replaced by absolute path of the referenced log file. e.g.

/home/dpospisi/runtimes/jboss-eap-6.1.ER8/standalone/log/server.log

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)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:212)
	at org.jboss.logmanager.handlers.FileHandler.setFile(FileHandler.java:154)
	at org.jboss.logmanager.handlers.PeriodicRotatingFileHandler.setFile(PeriodicRotatingFileHandler.java:105)
	at org.jboss.logmanager.handlers.FileHandler.setFileName(FileHandler.java:192)
	a
Comment 1 James Perkins 2013-05-16 16:01:50 EDT
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.
Comment 2 JBoss JIRA Server 2013-06-06 18:09:54 EDT
James Perkins <jperkins@redhat.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.
Comment 6 Josh West 2014-04-09 09:48:00 EDT
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.
Comment 7 James Perkins 2014-04-14 14:03:16 EDT
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.
Comment 8 James Perkins 2014-04-15 20:20:09 EDT
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:

handler.FILE.fileName=${jboss.server.log.dir}/server.log

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.
Comment 10 James Perkins 2014-09-16 11:46:08 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.