Layout, Logger Filter and Workflow Configurations
This section lists the sample code for logger, layout, filter, and workflow configurations.
Layout configuration
Log4j 1.2 Usage
Log4j 2.0 Usage
log4j.appender.epmPerformanceLogFile.layout=wt.log4j.jmx.TSVLayout
appender.epmPerformanceLogFile.layout.type = TSVLayout
Filter configuration
Log4j 1.2 Usage
Log4j 2.0 Usage
log4j.appender.IncomingRmiStats.threshold=WARN
appender.IncomingRmiStats.filter.threshold.type=ThresholdFilter
appender.IncomingRmiStats.filter.threshold.level=WARN
* 
For any assistance on filter configuration, contact the vendor. PTC does not provide support for any third-party configurations.
Windchill provides OOTB filtering capabilities as mentioned below:
Key word match filter
This filter provides filtering based on matching string provided and logs all loggers based on the key word provided. If the log level is set to Trace, then OOTB stack traces are logged.
Configuration
Example
logger.<logger_name>.name=<package_name>
logger.<logger_name>.level=<logger_level>
logger.<logger_name>.filter.<filter_name>.type=KeyWordMatchFilter
logger.<logger_name>.filter.<filter_name>.keyWordsToMatch=<keyword_to_search>
logger.<logger_name>.filter.<filter_name>.onMatch=ACCEPT/NEUTRAL/DENY
logger.<logger_name>.filter.<filter_name>.onMismatch=ACCEPT/NEUTRAL/DENY
logger.pomSql.name=wt.pom.sql
logger.pomSql.level=DEBUG
logger.pomSql.filter.keywordFilter.type=KeyWordMatchFilter
logger.pomSql.filter.keywordFilter.keyWordsToMatch=wt.part.WTPart
logger.pomSql.filter.keywordFilter.onMatch=ACCEPT
logger.pomSql.filter.keywordFilter.onMismatch=DENY
Focus filter
Using this filter configuration, existing stack traces are filtered based on the key words provided. This filter configuration does not print all the logs.
Configuration
Description
logger.<logger_name>.name=<class_name>
logger.<logger_name>.level=<log_level>
logger.<logger_name>.filter.<filter_name>.type=FocusedStackClassFilter
logger.<logger_name>.filter.<filter_name>.stackTraceStringMatch=<keyword_to_search>
logger.<logger_name>.filter.<filter_name>.onMatch=ACCEPT/NEUTRAL/DENY
Logger.<logger_name>.filter.<filter_name>.onMismatch=ACCEPT/NEUTRAL/DENY
logger.SOSM.name=wt.org.OrganizationServicesHelper
logger.SOSM.level=ALL
logger.SOSM.filter.stackClassFilter.type=FocusedStackClassFilter
logger.SOSM.filter.stackClassFilter.stackTraceStringMatch="wt.org.OrganizationServicesHelper.isPrincipalNameValid","com.ptc.jca.mvc.controllers.BreadCrumbController.getContextObject"
logger.SOSM.filter.stackClassFilter.onMatch=ACCEPT
logger.SOSM.filter.stackClassFilter.onMismatch=DENY
The values for filter can be one of the following:
ACCEPT — The event will be processed without further filtering based on the log Level.
NEUTRAL — No decision could be made, further filtering should occur.
DENY — The event should not be processed.
Logger configuration
Log4j 1.2 Usage
Log4j 2.0 Usage
log4j 1.2 usage for enabling loggers:
log4j.logger.com.ptc.windchill.upgrade=WARN
Log4j 2.0 usage for enabling loggers:
logger.WCUpgrade.name=com.ptc.windchill.upgrade
logger.WCUpgrade.level=WARN
where, WCUpgrade can be any unique name.
Log4j 1.2 usage for appending multiple appenders
# Limit com.infoengine.log* loggers to outputting to methodServerLogFile and MiscLogEvents
log4j.logger.com.infoengine.log=, methodServerLogFile, MiscLogEvents
log4j.additivity.com.infoengine.log=false
Log4j 2.0 usage for appending multiple appenders
# Limit com.infoengine.log* loggers to outputting to methodServerLogFile and MiscLogEvents
#Make sure to change the package structure as per your application
logger.infoengineLog.name=com.infoengine.log
logger.infoengineLog.additivity=false
logger.infoengineLog.appenderRef.methodServerLogFile.ref=methodServerLogFile
logger.infoengineLog.appenderRef.MiscLogEvents.ref=MiscLogEvents
Any custom workflow templates with expressions that use API from Log4j 1.2 version has be updated to use the appropriate API from Log4j 2.0 instead. If there are any running workflows with expressions using Log4j 1.2 API, you can use the Externalize Expressions to save the expressions in an external file before modifying the same. For more information on Externalize Expressions, refer Externalizing Expressions for a Workflow Template.
War dies hilfreich?