I see three main options:
Use Syslog
Use the Syslog core module:
The Syslog module logs events by sending messages to the logging
facility of your web server's operating system.
Using this module you can access all log messages thanks to the syslog subsystem.
Access the data directly
As Clive suggests, use the data that DBlog saves in the watchdog
table. The tables's structure for Drupal 7 is like this:
+-----------+---------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------+---------------------+------+-----+---------+----------------+
| wid | int(11) | NO | PRI | NULL | auto_increment |
| uid | int(10) unsigned | NO | MUL | 0 | |
| type | varchar(64) | NO | MUL | | |
| message | longtext | NO | | NULL | |
| variables | longblob | NO | | NULL | |
| severity | tinyint(3) unsigned | NO | MUL | 0 | |
| link | text | YES | | NULL | |
| location | text | NO | | NULL | |
| referer | text | YES | | NULL | |
| hostname | varchar(128) | NO | | | |
| timestamp | int(11) | NO | | 0 | |
+-----------+---------------------+------+-----+---------+----------------+
The error message is in the message
column, and the values of the tokens in the message are in the variables
column. To get the complete message you can use the function t, as dblog does:
$output = t($event->message, unserialize($event->variables));
In this case you probably access the data after the event is created and processed by drupal, in a batch process. Useful if you just want to store messages but not if you want to react in real time.
Hook to the watchdog
You can write your own module and get all watchdog messages when they are delivered. To do this you have to implement the hook_watchdog. In this case you receive the event at the time it's generated.