Overview: Logging application behavior

 

In this topic ...

What is tracked by Logging

Related Topics ...

Turn on Logging

Change Default Logging Level

View a Log File

Set up Custom Logging with the Logging Category Builder

Use Builder Built-in Logging

Use Logging with Data Page Builder

Overview: Debugging

You will often find it useful to debug an application by logging the output of arbitrary actions and methods during execution. However, the traditional means of placing System.out.println() statements in the code and later removing them prior to shipment is both tedious and error prone.

In the Factory we can get the same degree of information more simply by defining methods that can output to log files or the system console. And we can control the behavior of these methods through central logging properties.

The Factory provides two main ways of logging application behavior:

  • log4j Logging - The Factory also provides built-in log4j logging that we can manipulate through various property settings. In addition, we can specify your own log4j calls, using Builders to create log4j methods and then calling those methods to output to log files or the system console. After inserting these calls anywhere within the application where information is required, the we can control their activation through the same property settings.

  • Builder-based Logging - Certain Factory Builders provide built-in Logging functionality. We can manipulate this functionality individually for each Builder, or we can managed logging centrally for the model through the Debug Inputs panel or via profiling.

 

What is tracked by Logging

Log4j provides a means of logging messages of various priority levels when certain events within the program occur. Events, however, is a very relative term. The log4j information logging features is really nothing more than a method that is being called, but only at a certain priority level. So Events can be best defined as a location in the program where you place a logging method to be called. Remember, that the log4j information logging feature is synonymous with placing a System.out.println() (in Java) or printf() (in C/C++), only with priority levels.

The message that is logged is entirely up to the developer as we can pass any Java Object as the message into the log4j methods. This allows the developer to write variables, method calls and actions to the logs.

See the How do I... Log Application Behavior help topic for details on completing several logging tasks.