Re: Log file to sql database - Mailing list pgsql-general

From KuroiNeko
Subject Re: Log file to sql database
Date
Msg-id 3AC87A0D.nailN811TLE3@ed.ed
Whole thread Raw
In response to Log file to sql database  ("Joseph" <lters@mrtc.com>)
Responses RE: Log file to sql database
List pgsql-general
> Anyone care  to share suggestions on  getting data from a  running syslog
> into
> postgresql database?

 One way would be adding something like this to syslog.conf:

<facility>.<priority>                |/path/to/insert/routine

 However  that  might  impose  unwanted burden.  Also,  IIRC  syslog  keeps
`routine' loaded so making sure it doesn't waste precious cycles while idle
is up  to you.  This pipe would  be always ready  for reading,  so select()
might fail to work as desired.
 Another approach is to enhance log  rotation program to add the records to
the database. Depends on log rotation program :)
 YMMV, as always and good DB design for syslog is yet to be developed IMHO.
On one hand it has to be normalised enough to eliminate repetitions, on the
other hand,  it needs  to be  simple and flexible  to be  able to  adopt to
various not-so-standard programs that use syslog.
 At least,  facility, priority, timestamp,  hostname and process  (name and
PID) are quite common.


--

 ������������������


pgsql-general by date:

Previous
From: "Rod Taylor"
Date:
Subject: pg_dump -s puts out SETVAL lines
Next
From: Peter T Mount
Date:
Subject: Re: [JDBC] Logging Queries