You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Jayce^ <ja...@infogenix.com> on 2002/05/31 01:00:18 UTC

DBI error_log Logging

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I've been researching the different modules for pushing your access log to a 
dbi storage vs. local file and have one question which I'm not sure any of 
them are able to do yet.  Perhaps somebody has already thought of this and 
I'm just not seeing the answer (very likely).

I need to log my error_log entries also, not just the access log.

If there is one, especially if it's Apache::DBILogConfig  (my favorite 
appearing so far) with that same customization, that would be excellent.  
Otherwise I'd like to know, because I'll probably have to make one *real* 
quick :)   Also, if it has the ability to either trigger an event, or just 
log to file the inability to log via DBI, that would be nice.

Jayce^
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE89q8CoTgdT9hhlCIRAjoEAJwKsO9LYavsWMQGwUsD11E1Gr9HiACgl1yR
mvvJRsub4he4A4PaPoA8PEI=
=E5ID
-----END PGP SIGNATURE-----


Re: DBI error_log Logging

Posted by Geoffrey Young <ge...@modperlcookbook.org>.

Jayce^ wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> I've been researching the different modules for pushing your access log to a 
> dbi storage vs. local file and have one question which I'm not sure any of 
> them are able to do yet.  Perhaps somebody has already thought of this and 
> I'm just not seeing the answer (very likely).
> 
> I need to log my error_log entries also, not just the access log.
> 

this is _far_ trickier than you might suspect at first.  for a detailed 
explanation, see Recipe 16.6 in the mod_perl Developer's Cookbook.

the code we used to implement error log capturing is here:
 
http://www.modperlcookbook.org/code/ch16/Cookbook-DivertErrorLog-0.01.tar.gz

while sample (but working) code that uses the interface is here:

http://www.modperlcookbook.org/code/ch16/Cookbook/ErrorsToIRC.pm

paul, randy, and I were all able to get this module to work on three 
different platforms (including windows) but I'm still not sure how 
robust it is for production use.  nevertheless, it should give you an 
idea as to why there aren't any modules on CPAN that do this :)

--Geoff


Re: DBI error_log Logging

Posted by Geoffrey Young <ge...@modperlcookbook.org>.

Jayce^ wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> 
>>along those same lines, I forgot to mention Apache::LogSTDERR, which
>>is similar I suppose (though I've never used it).
>>
> 
> Any idea where I can find this one?  Searching CPAN doesn't give me anything.

http://www.modperlcookbook.org/download/Apache-LogSTDERR-0.12.tar.gz

but I thought Paul uploaded this to CPAN already...

--Geoff


Re: DBI error_log Logging

Posted by Jayce^ <ja...@infogenix.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> along those same lines, I forgot to mention Apache::LogSTDERR, which
> is similar I suppose (though I've never used it).

Any idea where I can find this one?  Searching CPAN doesn't give me anything.

Jayce^
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE896mgoTgdT9hhlCIRAuquAJ438twVFUW4ngfwOYuN0cCe+cT2PQCgg0px
0Sf3NEcRYmSJDOQXaAap1rg=
=YUEd
-----END PGP SIGNATURE-----


Re: DBI error_log Logging

Posted by Geoffrey Young <ge...@modperlcookbook.org>.

Cees Hek wrote:

> Quoting Jayce^ <ja...@infogenix.com>:
> 
> 
>>I've been researching the different modules for pushing your access log to a
>>
>>dbi storage vs. local file and have one question which I'm not sure any of 
>>them are able to do yet.  Perhaps somebody has already thought of this and 
>>I'm just not seeing the answer (very likely).
>>
>>I need to log my error_log entries also, not just the access log.
>>
> 
> For a non mod_perl way of dumping error_log into a DB just use the standard
> Apache ErrorLog directive with a pipe:
> 
> ErrorLog "| /usr/local/apache/bin/error_logger.pl"
> 

oh, yeah :)

along those same lines, I forgot to mention Apache::LogSTDERR, which 
is similar I suppose (though I've never used it).

additionally, if you are only interested in your own log statements 
and not errors thrown by mod_perl or Apache proper, then you can also 
try Apache::LogFile or Log::Dispatch (which is DBI friendly IIRC).

HTH

--Geoff


Re: DBI error_log Logging

Posted by Cees Hek <ce...@sitesuite.com.au>.
Quoting Jayce^ <ja...@infogenix.com>:

> I've been researching the different modules for pushing your access log to a
> 
> dbi storage vs. local file and have one question which I'm not sure any of 
> them are able to do yet.  Perhaps somebody has already thought of this and 
> I'm just not seeing the answer (very likely).
> 
> I need to log my error_log entries also, not just the access log.

For a non mod_perl way of dumping error_log into a DB just use the standard
Apache ErrorLog directive with a pipe:

ErrorLog "| /usr/local/apache/bin/error_logger.pl"

and in error_logger.pl just read from STDIN ( while (<>) {#do something} ) and
do what you please with the log entries.

Cees



> 
> If there is one, especially if it's Apache::DBILogConfig  (my favorite 
> appearing so far) with that same customization, that would be excellent.  
> Otherwise I'd like to know, because I'll probably have to make one *real* 
> quick :)   Also, if it has the ability to either trigger an event, or just 
> log to file the inability to log via DBI, that would be nice.
> 
> Jayce^
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.6 (GNU/Linux)
> Comment: For info see http://www.gnupg.org
> 
> iD8DBQE89q8CoTgdT9hhlCIRAjoEAJwKsO9LYavsWMQGwUsD11E1Gr9HiACgl1yR
> mvvJRsub4he4A4PaPoA8PEI=
> =E5ID
> -----END PGP SIGNATURE-----
> 
> 


-- 
Cees Hek
SiteSuite Corporation