Folks,
We want to be sure at any time that we are working in DEV or PROD environments.
We want to access some information about the server/worker we are running in.
we can access the IP of course but that’s not much use. Can we get the full server address or something similar?
try {
InetAddress id = InetAddress.getLocalHost();
logWarn("the hostname is " + id.getHostName());
} catch (UnknownHostException e) {
logWarn("cannot get hostname");
}
this may or may not help. The way I find out where I am at programmatically is by using a java snippet and extract context properties node in a component. Basics below:
Note on my server I have a folder structure that has live flows in a folder named Live and a folder for testing on a server called Test. My AP is used for dev’ing.
I use this component to make decisions about what to do. e.g. Live use x database table, Test use y database table, Dev use z database table. or log here, or anything really.