Managing Logging in Windchill+
Windchill+ does not support direct use of the third-party libraries. For logging of customizations in Windchill+ , interface wt.log4j.Logger and wt.log4j.LogManager are available and marked as supported. An example of using this functionality in customization is given below:
import wt.log4j.LogManager
import wt.log4j.Logger;
public class TestClass
{
private static final String CLASSNAME = TestClass.class.getName();
private static final Logger logger = LogManager.getLogger(CLASSNAME);
public void testMethod()
{
if (logger.isDebugEnabled())
{
logger.debug("In test method");
}
}
}
The interface wt.log4j.Logger exposes:
1. Methods to check if logging is enabled for fatal, error, warn, info, debug and trace log levels.
2. Methods to write messages according to the log level, controlled by enabling logs and setting log level as described below.
For more information on the supported APIs, see the JavaDoc.
Enabling the logs
Refer to the guidelines as specified below to enable logging in various environments:
Environment
Enabling logs
Method
Development
Logs are enabled at the development site by the user having site administration access.
Logs are enabled from the Monitoring Tools page.
Integration
Logs are enabled at the development site by the user having site administration access.
Logs are enabled from the Monitoring Tools page.
Production and QA
You are required to open a service request.
Logging is enabled by PTC from Monitoring Tools page.
To enable logging, open a service request. Logging is enabled by the PTC team by using of the Monitoring tools page.
A user with Site Administration access can enable logging from the Log Levels link on Site > Utilities > Server Status > Monitoring Tools page.
logger.CustomLogger.name=com.acme.TestLogger
logger.CustomLogger.level=ERROR
Setting the log level
The log level for the OOTB deployments is set as error. Open a service request to change the log level. Do not set the log level using customize Java file. Log the messages in the Windchill method server log file and not in a separate log file.
Segregating Customization Logs and OOTB Logs
Segregate the customization and the OOTB logs using a fixed pattern of the package convention. Following is an example of the package prefix for the user xyz:
"com.xyz.*" or "org.xyz.*"
Was this helpful?