Logging to the Activity Log

To create an entry in the Activity Log, use the following code sample:

MT->log({  
  message => "Something happened.",
  class => 'system',
  level => MT::Log::DEBUG(), 
});

MT->log Properties

  • message - The message to enter into the log.
  • class - The type of log entry. In most cases, the default "system" value is sufficient. The others are used to additional log information about content created in the system.
    • system (default)
    • comment
    • page
    • ping
  • level - The log level of nature of the log entry. This is used to differentiate between informational messages and errors.
    • MT::Log::INFO()
    • MT::Log::WARNING()
    • MT::Log::DEBUG()
    • MT::Log::SECURITY()
    • MT::Log::ERROR()
This page was last updated on 2008-09-17, 14:41.  

Leave a note

Have a question, please use the MT Forums. Notes sumbitted here should pertain to tips & hints regarding documentation. Your note may be removed once it's contents has be integrated into the body of the page.