Log4j categories

The following table lists Log4j Factory categories listed in the WEB-INF\config\log4j.properties file, and their functionality. Advanced users can use this information to modify Log4j logging behavior.

Category Name Logging at INFO Level Additional Functionality When the DEBUG Level Is Used
bowstreet.system.modelActions
  • Logs all model actions (methods, pages, action lists, linked Java object calls) for a specifieed model

  • Session ID

  • Model name

  • Action name

  • Timing

No additional information is logged
bowstreet.system.modelActions.[modelName] 1

  • Logs all model actions (methods, pages, action lists, linked Java object calls) for a specified model

  • Session ID

  • Model name

  • Action name

  • Timing

To log for a single model within a local directory, use underscores (_) to denote the path.

For example, to log for a model named myModel located in a directory named myDir, the syntax is as follows: system.modelActions.myDir_myModel

No additional information is logged
bowstreet.system.request

  • Requests

  • Session ID

  • Model name

  • Action name

  • Timing
Request parameters are logged.
bowstreet.system.profileSelection

  • Session ID

  • Profiles selected (including profile set name)

  • Model name
No additional information is logged
bowstreet.system.regen

  • Regen information

  • Session ID

  • Profiles selected

  • Model name
No additional information is logged
bowstreet.system.builderCalls

  • Session ID

  • Model name

  • Builder ID

  • Builder inputs
No additional information is logged
bowstreet.system.webservice.incomingSOAPRequest

  • Incoming SOAP requests

  • Timing

  • Action name

  • Model name
It logs the following:

  • SOAP arguments

  • Return results
bowstreet.system.webservice.serviceCall

  • Service calls

  • Session ID

  • Model name

  • Outgoing request URL

  • Timing
No additional information is logged

1 Not in the file by default, but it can be added.

 

Change Destination of the Appender

By default the Factory sends the output of the logging to a command prompt window and to a text file. We can modify the output so that it is sent to other ways, such as the following:

  • GUI components

  • remote socket servers

  • Java Message Service

  • Windows NT event loggers

  • remote UNIX system log daemons

For example, assume you want logged requests to be sent to an additional file. When you specify an appender to send logging output to a file, specify the following:

  • the layout of the output

  • the location of the output file

  • whether the output file should be truncated

The following steps assume you want the logging requests to be sent to an additional file:

  1. Open the WEB-INF\config\log4j.properties file.

  1. Add an appender name to the value of log4j.category.bowstreet.system.request, as shown below.

log4j.category.bowstreet.system.request=DEBUG,Console,Request,SecondFileName

where SecondFileName is the name of the appender.

  1. Prefix the name added in the previous step with log4j.appender. and set it equal to the type of appender you want, as shown below.

log4j.appender.SecondFileName=org.apache.log4j.FileAppender

For a listing of outputs for appenders, see the section, "Listing of Outputs and Their Definitions."

  1. Specify the location of the file, as shown below:

log4j.appender.SecondFileName.File=${bowstreet.rootDirectory}/logs/anotherlogfile.txt

where ${bowstreet.rootDirectory}/logs/anotherlogfile.txt is the location of the output

Notice that the category name log4j.appender.SecondFileName.File contains the name of the appender. Thus, the name of this category changes according to the name of the appender.

  1. Determine if you want the logging to be appended to the pre-existing file rather than overwriting it. The log4j.appender.SecondFileName.Append category determines if the file should be overwritten or appended. When it is set to false, the file will be overwritten instead of appended to the end of the existing file, as shown below:

log4j.appender.SecondFileName.Append=false

Notice that the log4j.appender.SecondFileName.Append category contains the name of the appender, SecondFileName. Thus, the name of this category changes according to the name of the appender.

  1. Save the file.

  1. Restart the application server.

 

Appenders and Their Definitions

The following table lists the appender selections and how you would define them.

Appender Definition
Console org.apache.log4j.ConsoleAppender

For example,

log4j.appender.Console=org.apache.log4j.ConsoleAppender

File org.apache.log4j.FileAppender

For example,

log4j.appender.Console=org.apache.log4j.FileAppender

Remote Socket Server org.apache.log4j.net.SocketAppender

For example,

log4j.appender.Console=org.apache.log4j.net.SocketAppender

Java Message Service org.apache.log4j.net.JMSAppender

For example,

log4j.appender.Console=org.apache.log4j.net.JMSAppender

Windows NT Event Logger1 org.apache.log4j.nt.NTEventLogAppender

For example,

log4j.appender.Console=org.apache.log4j.nt.NTEventLogAppender

remote UNIX Syslog daemon org.apache.log4j.net.SyslogAppender

For example,

log4j.appender.Console=org.apache.log4j.net.SyslogAppender

1To prevent the error message, java.lang.UnsatisfiedLinkError, place the file NTEventLogAppender.dll in a directory that is on the PATH of the Windows system.

For more information about the outputs, refer to the documentation at http://jakarta.apache.org/log4j/docs/documentation.html.