Step 2: Entering log properties

The License and Log Properties window in Development Studio enables you to define logging in the application. Currently, there are two tabs:

  • Application License: The use of this tab has been disabled and will no longer require you to provide license key and license server details to use the application.

  • Log4J Properties: Sets the properties for the log4j logging framework for the entire application.

Log4J Properties

Log4J properties are saved in the file log4j.properties and deployed as a part of the application. Here, you can control what is logged from the application. Most important is the logging level. It should be DEBUG only when debugging — set it to WARN when the application goes live.

You can use this sample log4j code:

# use this file to get log4j loggers to log to the WebSphere SystemOut.txt file  

# Set root logger level to DEBUG and its only appender to console.
log4j.rootLogger=DEBUG, console

# Setup parent logger of application with level DEBUG and appender console
log4j.logger.com.intentia.iec=DEBUG, console

# Setup parent logger of presentation (*.jsp files from DC) with level DEBUG and appender console
log4j.logger.com.intentia.iec.jsp=DEBUG, console

# Setup parent loggers of deployment tools with level DEBUG and appender console
log4j.logger.org.apache.tools.ant=DEBUG, console
log4j.logger.xdoclet=DEBUG, console

# console is set to be a ConsoleAppender.
log4j.appender.console=org.apache.log4j.ConsoleAppender

# console uses PatternLayout.
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%-4r [%t] %-5p %2c %x - %m%n

# the parent loggers should not inherit appenders from their ancestors
# in order to avoid logging to appenders from other configurations
log4j.additivity.com.intentia.iec=false
log4j.additivity.com.intentia.iec.jsp=false
log4j.additivity.org.apache.tools.ant=false
log4j.additivity.xdoclet=false