Thread: Tracing in Postgres
Hi,
I am trying to integrate a tracing framework in the Postgres code.
I need to know if elog.c under backend/utils/error is the place where the changes can be made.
The tracing framework that I want to integrate has some additional capability. I want to replace the tracing and logging functionality in the existing Postgres framework with the APIs used in this framework without making changes in every file.
If anybody has any inputs on this, please help me.
Thanks,
Harshitha
On Fri, Jul 22, 2011 at 5:00 AM, Harshitha S <hershetha@gmail.com> wrote: > I am trying to integrate a tracing framework in the Postgres code. > I need to know if elog.c under backend/utils/error is the place where the > changes can be made. Depends on what your tracing framework is trying to do. > The tracing framework that I want to integrate has some additional > capability. I want to replace the tracing and logging functionality in the > existing Postgres framework with the APIs used in this framework without > making changes in every file. > If anybody has any inputs on this, please help me. If you just want to analyze the log messages, I would suggest letting PostgreSQL to write them out to files and then postprocessing the files. It will be less work. Also, there's a pretty limited amount of processing that is safe to do in elog.c. Some arbitrary part of the system has blown up, so you can't (just to take one example) read from the database at that point. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
I want to retain all the error messages, error report that is used by Postgres.
I don't intend to log any information extra other than what is provided by Postgres.
But I just want to replace the implementation of the logging/tracing in Postgres, so that the existing messages can be redirected to a file, a USB etc., There is an existing tracing frameworkfor this,I intend to use the API s provided by this framework.
Regards,
Harshitha
On Fri, Jul 22, 2011 at 9:08 PM, Robert Haas <robertmhaas@gmail.com> wrote:
On Fri, Jul 22, 2011 at 5:00 AM, Harshitha S <hershetha@gmail.com> wrote:Depends on what your tracing framework is trying to do.
> I am trying to integrate a tracing framework in the Postgres code.
> I need to know if elog.c under backend/utils/error is the place where the
> changes can be made.If you just want to analyze the log messages, I would suggest letting
> The tracing framework that I want to integrate has some additional
> capability. I want to replace the tracing and logging functionality in the
> existing Postgres framework with the APIs used in this framework without
> making changes in every file.
> If anybody has any inputs on this, please help me.
PostgreSQL to write them out to files and then postprocessing the
files. It will be less work. Also, there's a pretty limited amount
of processing that is safe to do in elog.c. Some arbitrary part of
the system has blown up, so you can't (just to take one example) read
from the database at that point.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
On Mon, Jul 25, 2011 at 12:59 AM, Harshitha S <hershetha@gmail.com> wrote: > I want to retain all the error messages, error report that is used by > Postgres. > I don't intend to log any information extra other than what is provided by > Postgres. > But I just want to replace the implementation of the logging/tracing in > Postgres, so that the existing messages can be redirected to a file, a USB > etc., There is an existing tracing frameworkfor this,I intend to use the API > s provided by this framework. I'd suggest that you look at adding the functionality you are interested in to the logging collector, rather than putting it directly in elog.c. That's pretty much exactly what the logging collector is designed to do, so you'd be extending or adjusting existing functionality, rather than reinventing the wheel. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company