Login / Status
developer.Resource
Home . Documentation . Document Library . Extension Manuals
Sponsors
hosted by punkt.deTYPO3 and Open Source Magazine

1.3. User manual

Using the logging method

To log something simply call t3lib_div::devLog(). This method takes the following parameters:

Parameter

Information

$msg

The message that you want to write to the log

$extKey

The key of the extension writing to the log

$severity

Indication of the severity of the message. The following values are expected:

  1. -1 for ok status

  2. 0 for a purely informational message

  3. 1 for a notice

  4. 2 for a warning

  5. 3 for a (fatal) error

This parameter is optional and defaults to 0.

$dataVar

This is an array that can contain any data you wish and that you find useful for information or debugging purposes. It is serialised before being stored in the database. In the backend module it is unserialised and displayed as with t3lib_div::debug().

This parameter is optional and defaults to false.

Backend module

The backend module provides a way to visualise the entries generated by calls to t3lib_div::devLog() (see screenshot above) and to clean up those entries. The function menu (1) gives access to those two main views

1) Show log

This screen can be used to filter and browse through the log entries. Many functions are available. First of all, you can choose which entries you want to display (1). This can be either the latest log run or any of the older ones, but also all entries or some of the latest (25, 50 or 100). Additionally you can set the screen to automatically refresh itself (2), which it then does at an interval of 2 seconds. Most useful in conjunction with the autorefresh feature, the screen can be opened in a new window (3).

The log view itself offers several more options. By clicking on the uid of a log entry (1), you can set a filter to display only the log run this entry belongs to. You can also click on the (+) icon to get a view of the deserialised extra data (4). This is displayed inline using JavaScript.

When viewing all entries you get yet more options. First of all results are paginated (25 entries a page) and you can navigate through them using the page browser (2). What's more various filters (3) are available to select entries based on severity or extension key.

2) Clean up

This screen allows to purge log entries. It can only purge all the existing log entries and nothing finer. More work is planned on that part (see To-Do list below).