| |
|
| java.lang.Object org.jzonic.jlo.VariableManager
VariableManager | public class VariableManager (Code) | | This class manages all variables for all log configurations.
Every handler or formatter can use this class to replace
any variables that are used inside of the parameters.
Please refer to the specific handler or formatter to see
which parameters support the use of variables.
author: Andreas Mecky author: Terry Dye |
addVariable | public void addVariable(String varName, String varValue, String configName)(Code) | | This method adds a variable for a given configuration.
Parameters: varName - name of the variable Parameters: varValue - the value for this variable Parameters: configName - the configuration to which this variable belongs |
getInstance | public static VariableManager getInstance()(Code) | | This method will return an instance of the VariableManager
the one and only instance of the VariableManager |
getVariableCount | public int getVariableCount(String configName)(Code) | | This method returns the number of variables
for one specific configuration. If the configuration
does not exist it will return 0;
Parameters: configName - the name of the configuration the number of variables |
replaceEnvVar | public String replaceEnvVar(String text)(Code) | | This method replace all occurences ${env:xxx} with
the value of an environment variable. If the env-variable
does not exist then the part is not converted. The
method gets called from replaceVariables
Parameters: text - the line of text that will be processed a String with the replaced env-variables. |
replaceVariables | public String replaceVariables(String text, String configName)(Code) | | This method will replace all variables inside one String that
are in this configuration. A variable is used as ${name}.
This occurance will be replaced with the specific value
or will be left as is if the variable name is not found
in the specific configuration. This method calls replaceEnvVars
at the end to replace environment variables.
Parameters: text - the line of text which contains variables Parameters: configName - the name of the configuration a String where all variables are replaced with their values |
|
|
|