views:

130

answers:

1

I am sending php errors, all mysql queries, apache2 errors and mod_rewrite debugging to one file, needless to say it's busy in there.

Can the format be changed from:

[22-Jul-2009 23:00:58] Parameters: 
GET Array
(
)

POST Array
(
)
    [22-Jul-2009 23:00:58] Finding Associations
             237 Query       SELECT `table`.* FROM `table` WHERE 1=1 ORDER BY date ASC
             237 Query       SELECT `table2`.* FROM `table2` WHERE RAND()  ORDER BY id
             237 Quit       
    [Wed Jul 22 23:00:58 2009] [error] [client 127.0.0.1] script '/var/www/default/public/static/js/menu.js' not found or unable to stat, referer: http://localhost
    [Wed Jul 22 23:00:58 2009] [error] [client 127.0.0.1] script '/var/www/default/public/404.php' not found or unable to stat, referer: http://localhost
    090722 23:03:00     238 Connect     development@localhost on project
             238 Query       SELECT @@sql_mode
             238 Query       SET SESSION sql_mode=''
             238 Query       SET NAMES utf8
             238 Query       SELECT @@SQL_MODE
             238 Query       SHOW FULL COLUMNS FROM `table`.`users`

to something with less tabbing etc, i'm tailing the log file and would ideally like to add some colour later on aswell.

This has come about after getting involved in some RoR development and i'm missing the rails console output.

+1  A: 

I would take a look at the Log class in Pear: http://pear.php.net/package/log/

It's pretty flexible and may allow you to customize things a bit better... certainly will look nicer than sending everything through something apache's error log. If anything, the code isn't terrible in the package, so you should be able to tweak things to your liking... I haven't come across anything as spiffy as the rails console tho.

Ian Selby