logerrors
logerrors : Function for collecting statistics about messages in logfile
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 7140 | logerrors | logerrors | 2.1.6 |
SEC | PostgreSQL | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --sLd-r | No | Yes | Yes | Yes | yes | no |
| Relationships | |
|---|---|
| See Also | pg_stat_log pgelog pg_sqlog log_fdw pgaudit pgdisablelogerror pg_auth_mon pgfr_record |
Packages
| Linux / PG | PG19 | PG18 | PG17 | PG16 | PG15 |
|---|---|---|---|---|---|
| el8.x86_64 | N/A | PGDG 2.1.6 | PGDG 2.1.6 | PGDG 2.1.6 | PGDG 2.1.6 |
| el8.aarch64 | N/A | PGDG 2.1.6 | PGDG 2.1.6 | PGDG 2.1.6 | PGDG 2.1.6 |
| el9.x86_64 | PGDG 2.1.6 | PGDG 2.1.6 | PGDG 2.1.6 | PGDG 2.1.6 | PGDG 2.1.6 |
| el9.aarch64 | PGDG 2.1.6 | PGDG 2.1.6 | PGDG 2.1.6 | PGDG 2.1.6 | PGDG 2.1.6 |
| el10.x86_64 | PGDG 2.1.6 | PGDG 2.1.6 | PGDG 2.1.6 | PGDG 2.1.6 | PGDG 2.1.6 |
| el10.aarch64 | PGDG 2.1.6 | PGDG 2.1.6 | PGDG 2.1.6 | PGDG 2.1.6 | PGDG 2.1.6 |
| d12.x86_64 | PIGSTY 2.1.6 | PIGSTY 2.1.6 | PIGSTY 2.1.6 | PIGSTY 2.1.6 | PIGSTY 2.1.6 |
| d12.aarch64 | PIGSTY 2.1.6 | PIGSTY 2.1.6 | PIGSTY 2.1.6 | PIGSTY 2.1.6 | PIGSTY 2.1.6 |
| d13.x86_64 | PIGSTY 2.1.6 | PIGSTY 2.1.6 | PIGSTY 2.1.6 | PIGSTY 2.1.6 | PIGSTY 2.1.6 |
| d13.aarch64 | PIGSTY 2.1.6 | PIGSTY 2.1.6 | PIGSTY 2.1.6 | PIGSTY 2.1.6 | PIGSTY 2.1.6 |
| u22.x86_64 | PIGSTY 2.1.6 | PIGSTY 2.1.6 | PIGSTY 2.1.6 | PIGSTY 2.1.6 | PIGSTY 2.1.6 |
| u22.aarch64 | PIGSTY 2.1.6 | PIGSTY 2.1.6 | PIGSTY 2.1.6 | PIGSTY 2.1.6 | PIGSTY 2.1.6 |
| u24.x86_64 | PIGSTY 2.1.6 | PIGSTY 2.1.6 | PIGSTY 2.1.6 | PIGSTY 2.1.6 | PIGSTY 2.1.6 |
| u24.aarch64 | PIGSTY 2.1.6 | PIGSTY 2.1.6 | PIGSTY 2.1.6 | PIGSTY 2.1.6 | PIGSTY 2.1.6 |
| u26.x86_64 | PIGSTY 2.1.6 | PIGSTY 2.1.6 | PIGSTY 2.1.6 | PIGSTY 2.1.6 | PIGSTY 2.1.6 |
| u26.aarch64 | PIGSTY 2.1.6 | PIGSTY 2.1.6 | PIGSTY 2.1.6 | PIGSTY 2.1.6 | PIGSTY 2.1.6 |
Source
github.com/munakoiso/logerrors
logerrors-2.1.6.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Config this extension to shared_preload_libraries:
Create this extension with:
Usage
Sources:
logerrors collects counts of WARNING, ERROR and FATAL messages through server hooks. Release 2.1.6 fixes PostgreSQL 19 ABI/build compatibility while retaining SQL extension version 2.1.
Enable and inspect
Add the library to the existing preload list, restart PostgreSQL, then create the SQL extension:
pg_log_errors_stats() returns collection intervals, message types, counts, role/database names and SQLSTATE. pg_slow_log_stats() reports slow-log counts and reset time; pg_log_errors_reset() resets statistics.
Configuration
logerrors.interval controls the collection interval in milliseconds: default 5000, maximum 60000. logerrors.intervals_count retains 120 intervals by default, at most 360. logerrors.excluded_errcodes accepts comma-separated error codes.
These are bounded in-memory statistics, not a durable audit archive. Restrict access to operational information according to database policy. Replacing the library requires a restart because it is preloaded; SQL extversion 2.1 alone does not identify the 2.1.6 runtime fix.