Re: Log por usuario

From: Luis D(dot) García <ldgarc(at)gmail(dot)com>
To: "Jose J(dot) Ayala Pineda" <jayala(at)cromotex(dot)com(dot)pe>
Cc: pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: Log por usuario
Date: 2009-04-30 23:22:54
Message-ID: 3de424340904301622l231c8c57l418795bdd3ced855@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

El 29 de abril de 2009 11:47, Jose J. Ayala Pineda
<jayala(at)cromotex(dot)com(dot)pe>escribió:

> Hola, estuve viendo los log que genera postgres y he visto que pone el
> log de las sentencias, warnings y notices que se generen.. pero no he
> encontrado la informacion de que usuario o desde que cliente se realizo
> dicha instruccion.
>
>
Hola José, cuando yo deseo hacer ese tipo de levantamientos de información y
filtrarlos de acuerdo a ciertas condiciones, lo que hago es activar la
recolección de logs vía CSV [1].

"Including csvlog in the log_destination list provides a convenient way to
import log files into a database table. This option emits log lines in
comma-separated-value format, with these columns: timestamp with
milliseconds, user name, database name, process ID, host:port number,
session ID, per-session or -process line number, command tag, session start
time, virtual transaction ID, regular transaction id, error severity, SQL
state code, error message, error message detail, hint, internal query that
led to the error (if any), character count of the error position thereof,
error context, user query that led to the error (if any and enabled by
log_min_error_statement), character count of the error position thereof,
location of the error in the PostgreSQL source code (if
log_error_verbosityis set to
verbose)."

Ventajas: puedes realizar cualquier tipo de consultas sobre los logs una vez
que los hayas cargado a la tabla respectiva

Desventajas: si se trata de un sistema con mucha actividad los logs pueden
tener una tasa de crecimiento bastante grande.

Saludos.

[1]
http://www.postgresql.org/docs/current/static/runtime-config-logging.html -
Sección 18.7.4

--
Luis D. García M.

Telf: (+58) 2418662663
Cel.: (+58) 4123497674

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Reynier Perez Mira 2009-04-30 23:50:16 RE: [pgsql-es-ayuda] OT - Aplicación Web
Previous Message Gabriel Ferro 2009-04-30 23:04:24 booleanos de postgres en VB