El 29 de abril de 2009 11:47, Jose J. Ayala Pineda <[email protected]>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
