Community Tip - You can change your system assigned username to something more personal in your community settings. X
Hello Everybody,
How to get the Get-Properties webject to retrieve the xxxxxx.verbose property from the wt.properties file?
Currently, I create tasks have several System.out.println() statements that output information to the Method Server window and log. This is desirable during development, when we frequently need to debug code. However, in production this can slow the application, waste disk space, and make the logs less readable.
Instead of deleting the output statements entirely, it would be nice if it could be switched on and off using a wt.properties entry.
How i can enhance the task to only execute the System.out.println() statements if the wt.properties entry xxxx.verbose is set to true.
Hi Shravan,
You can retrieve the property value using the Get-Properties webject or simply using the following API.
<%
String verbose = wt.util.WTProperties.getLocalProperties().getProperty("ext.myCustomVerbose");
System.out.println("Hello"+verbose);
%>
For other purposes, I would suggest using a logger as shown below to avoid MS restart.
private static final Logger log;
static {
try {
log = LogR.getLogger(MyClass.class.getName());
} catch (Exception e) {
throw new ExceptionInInitializerError(e);
}
}
// usage
log.trace("Called from xyz method");
Regards,
Bhushan
Thank you Bhushan
Regards
Shravan