Advanced Customization > Info*Engine User’s Guide > Info*Engine Custom Tag Reference > Info*Engine Tags > Supplied Library Tags (Logging)
  
Supplied Library Tags (Logging)
This tag library adds support for ease of use of log4j logging from within Info*Engine tasks without the need to use scriptlets. It is important to note that this tag library is not a custom extension, but is actually natively supported by the Info*Engine task compiler.
The following tags are included in the http://www.ptc.com/infoengine/taglib/log tag library. To use these tags, you must include a taglib directive in your task similar to the following:
<%@ taglib uri="http://www.ptc.com/infoengine/taglib/log"
prefix="log" %>
The syntax for these tags assumes that you have specified the log prefix in the taglib directive. If you specify a different prefix, use the prefix you specified in place of log in the tag syntax.
setLogger
Sets the log4j logger to be used. If this tag is not used, then the default logger name for a task is based on its location within the task root using its parent directory name prefixed with com.infoengine.tasks. For example, if your task is “/org/myCompany/MyTask.xml” then the default logger name is “com.infoengine.tasks.org.myCompany.”
In general, the setLogger tag is seldom used since the default logger names should be sufficiently granular for adequate logging control. This tag is useful if you would your task to reuse another existing logger in use by your application, thereby allowing you to control logging for your application under a custom logger hierarchy.
Syntax
<log:setLogger logger="LOGGER_NAME"/>
Attribute Descriptions
Required attribute: logger
logger
The logger name to use. This attribute is required and is also an expression.
Example
<log:setLogger logger="org.myorg.MyApplicationLogger"/>
info, debug, warn, error, trace
There is one tag for each corresponding log4j log level. Each tag issues a log message to the corresponding log method.
Syntax
<log:LEVEL message="log message"/>
Attribute Descriptions
Required attribute: message.
message
The log messages to be issued. This attribute is required and is also an expression.
Example
<log:info message="INFO Message" />
<log:warn message="WARN Message" />
<log:debug message="Group g cotains ${g.elementCount} elements." />
<log:error message="ERROR Message" />
<log:trace message="TRACE Message" />