-
1. Re: access-log configuration doesn't allow relative-to path configuration
jaysensharma Jun 2, 2012 10:31 AM (in response to rsinghal)HI Ravi,
You should define the <paths> first in your configuration file then only you can use the relative to ....
Example:
==========
<paths> <path name="access-log-dir" path="C:/test-logs" /> </paths>
Then try :
==========
<virtual-server name="default-host" enable-welcome-root="true"> <alias name="localhost"/> <alias name="example.com"/> <access-log pattern="Time Taken: %T %h %l %u %t %r %s %b" rotate="true"> <directory path="access-log" relative-to="access-log-dir"/> </access-log> </virtual-server>
A logical name for a filesystem path. The domain.xml, host.xml and standalone.xml configurations all include a section where paths can be declared. Other sections of the configuration can then reference those paths by their logical name, rather than having to include the full details of the path (which may vary on different machines).
To Know more about <path> element please refer to the following link:
https://docs.jboss.org/author/display/AS7/General+configuration+concepts
-
2. Re: access-log configuration doesn't allow relative-to path configuration
rsinghal Jun 2, 2012 10:32 PM (in response to jaysensharma)Thanks Jay, it worked. Now, I want to pass access log location through system property -DACCESS_LOG_LOCATION="
C:/test-logs
". I am using below entry but it's not resolving ACCESS_LOG_LOCATION:<paths> <path name="access-log-dir" path="${ACCESS_LOG_LOCATION}" /> </paths>
-
3. Re: access-log configuration doesn't allow relative-to path configuration
jaysensharma Jun 3, 2012 9:13 AM (in response to rsinghal)Hi Ravi,
There are some property substitution related issues which are fixed in JBoss AS7.2 so you will need to try the same test on the Nightly build (latest build) of JBoss AS7, the property substitution will definitely work there.
-
4. Re: access-log configuration doesn't allow relative-to path configuration
rsinghal Jun 3, 2012 8:25 AM (in response to jaysensharma)I am using last nighlty build which was available i.e. 9th May build . I may need to build it from the 7.1.2 tag if it's fixed there. Many thanks for your help.
-
5. Re: access-log configuration doesn't allow relative-to path configuration
sanssan Jan 16, 2013 12:12 PM (in response to jaysensharma)Thanks Jay.
It worked good with me. I do have 1 query addition to this...
<server xmlns="urn:jboss:domain:1.2"> <extensions> ............... </extensions> <system-properties> <property name="myapp.config.file.path" value="app"/> </system-properties> <paths> <path name="myapp.applog" path="app" relative-to="jboss.server.log.dir"/> </paths> ............... </server>
I can access System property like below on my Java class
System.getProperty("myapp.config.file.path");
But,
System.getProperty("myapp.applog");
returning null.