Index |
|
Environment Variable Expansion |
||||||
The Wrapper supports environment variable expansion at run time within the values of any property.
To maintain the platform independent nature of the configuration file
"wrapper. When the Wrapper is run as a service, environment variables will be loaded from the system registry rather than from the environment. This is necessary because Windows loads the environment variables which are available to services when the machine is booted. Any changes to the system environment variables in the registry (set directly or through the system control panel) are not made available to the services until the machine is once again rebooted. By loading the environment variables from the registry, the reboot can be avoided while providing the same functionality.
This will expand at runtime to a fully qualified path on any system which defines the JAVA_HOME environment variable.
NOTEIf a referenced environment variable is not defined, then a warning will be logged and it will be left unchanged in the property value. Starting from version 3.5.55, it is possible to disable variable expansion in sections of the configuration file (and avoid warning messages) using the #variables.expand directive. |
Environment Variable Definition |
|||||||||
The Wrapper supports the ability to define environment variables from within the configuration file
"wrapper. Special Property Name starting with "set." and "set.default." :
Environment variables are defined by using special property names which begin with
"set.
If the "set.
Example: The ability to define environment variables makes it possible to easily modify values that may be used throughout a configuration file. The example below shows how an environment variable can be used to specify the location of an external application.
The use of environment variables definitions can be very powerful if you understand how and when their values are set. Environment variables which were set before the Wrapper is launched, can, of course, be used as usual. If the same variable name is specified in the configuration file, then the value in the configuration file will override the existing value. From Command Line:
Environment variables defined from the command line work a little differently.
These values from command line will override any values from
either the system or those set in the configuration file.
This makes it possible to define default environment variables within the configuration file
"wrapper.
NOTENotice that, like all properties set from the command line, properties including spaces can be defined by including the entire pair of "property name and value" in quotes. NOTEThere is a known issue where variables set with circular references would grow up each time the configuration is reloaded (which is required at least one time on startup and optionaly when restarting the JVM). A typical example is when appending a path to the PATH environment variable:
We are currently working on a solution to fix this issue, but in the meantime a workaround is to make use of a temporary variable that is only set once:
|
Default Environment Variable Definitions |
||||||||||||||||||||||||
On startup, the Wrapper sets the following environment variables into its own environment.
These variables can be used within the configuration file
"wrapper.
|
Pseudo-environment Variable Definitions |
||||||||||||
In addition to the above environment variables, the following variables are generated by the Wrapper without actually being stored in the environment. The WRAPPER_RAND_NNNNNN and WRAPPER_TIME_YYYYMMDDHHIISS variables can be referenced multiple times in the configuration file, and may generate different values for each reference. For this reason they are not stored in the environment. You can however store the generated value for a single reference in your own environment variable using the "set.<X>" syntax, but be aware that each time the value of an environment variable is changed, the call to the underlying system function will result in a small memory leak. This should be taken into account if the configuration file can be reloaded multiple times as the value of these variables will be regenerated and change each time.
|
Event Handler Variable Definitions |
||||
The following variables can be referenced in event properties and used when those events are fired. These variables are also pseudo-environment variables, meaning that they are not stored in the environment.
|
Masking sensitive data |
||||||||||
The %. This notation should not be confused with a variable definition. It simply uses the same '%' delimiters as for variables to indicate that it will be expanded when processing the configuration file. Sensitive text or data to be masked in the log outpout must be written between the opening delimiter '%' and the '|' character. For internal use of the Wrapper or Java application, this notation will be expanded to only the sensitive data, removing the '%' delimiters as well as the '|mask' part. For the log output, sensitive data will be replaced by '*' characters. This notation is especially useful for masking passwords, for example in the value of a wrapper.app.property.<n> property.
The above configuration will generate the following log output if you set wrapper.properties.dump.loglevel to INFO.
|