metamod:logging

This is an old revision of the document!


METAMOD logs events that happen in the system. The logging of these events can be used for IT operations and simplifying development.

To provide scalable and standardised logging, METAMOD uses the Log::Log4perl framework in Perl code and the Log4php framework in PHP code. Both of these frameworks are ports of the log4j logging framework for Java. By using a standardised logging framework the same configuration file can be used for both the Perl and PHP part of METAMOD. Though the config file is mostly the same for Perl and PHP there are some difference and we use the format understood by PHP. The reason for using the PHP format is that it is significantly simpler to make the changes runtime in the Perl code.

It is important to understand how the log4p* frameworks work before you start using them. This article gives a good introduction to the central concepts of the frameworks: http://www.perl.com/pub/a/2002/09/11/log4perl.html

METAMOD uses the following log levels with the following definition.

  • FATAL: requires instant human assistance (IT operations). For instance full disks, lack of connection to database servers, file servers or LDAP.
  • ERROR: serious error, but isolated to current task/request. Does not affect entire METAMOD instance. IT operations should be notified.
  • WARNING: Might be an error, but not necessarily. Should be looked at to see if it is an actual problem.
  • INFO: Used to track main application use in production. For instance tracking user log in, uploads, metadata parsing info and other statistics
  • DEBUG: Free to be used by the developers as they see fit during development. DEBUG logging should rarely be used in production.

METAMOD uses the following categories for log messages. The categories correspond with the main parts of the application.

  • Metamod
    • search
    • harvest
    • oai-pmh
    • upload
    • base
    • adm
    • common

By default METAMOD uses two appenders. One for logging just FATAL and ERROR messages and one for logging all messages in the same file.

Monitoring of the logs is done using…. FIXME

The logging configuration for Perl can be changed at runtime … FIXME

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • metamod/logging.1277887417.txt.gz
  • Last modified: 2022-05-31 09:23:19
  • (external edit)