J F W

making web application programming easier is possible

HOW TO : CORE

logging

The log system is based on Log4J. You can see an example of Log4J configuration here.
The framework class in use for logging is JFWLogger. This class uses some parameters, to work correctly; you can find the configuration of the parameters here.

There are 5 levels of logging:

  1. DEBUG: used for debugging the application. Normally these kind of messages are not visible in production systems.
  2. PROFILE: used for profiling the application.
  3. INFO: used for all the messages related to application status.
  4. WARNING: messages of this type indicate a situation that does not compromise the correct functionality of the application but must be check by a system administrator.
  5. ERROR: used for report critical messages that compromise the correct functionality of the application.
Here is an example of use of the logger:

The log messages are visible in the log files set in log4j.xml. Is also possible to use the Log viewer for see the log messages and for change the log level on the fly.