# pg_logforward **Repository Path**: mirrors_markokr/pg_logforward ## Basic Information - **Project Name**: pg_logforward - **Description**: Logging handler for forwarding PostgreSQL log messages to network. - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-25 - **Last Updated**: 2026-02-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README Introduction ============ pg_logforward is a custom logging handler for PostgreSQL. It intercepts all PostgreSQL log messages by hooking into EmitErrorReport() function in the backend. The intercepted log messages are forwarded via UDP to a remote location. Requires PostgreSQL logging hooks patch - included in the patches directory. The patch is against 9.2devel but also applies against 9.1 and 8.3. Although some offsets are expected. Building ======== USE_PGXS=1 make install Output formats ============== The current version supports JSON, netstring and Syslog output formats. Usage ===== Modify postgresql.conf to include: shared_preload_libraries = 'pg_logforward' # requires restart custom_variable_classes = 'logforward' # deprecated in 9.2 logforward.target_names = 'syslog,jsonsrv,netstr' logforward.syslog_host = '127.0.0.1' logforward.syslog_port = 23456 logforward.syslog_min_elevel = 19 # WARNING and above logforward.syslog_format = 'syslog' logforward.syslog_facility = 'local1' logforward.jsonsrv_host = '127.0.0.1' logforward.jsonsrv_port = 23457 logforward.jsonsrv_message_filter = 'connect' logforward.jsonsrv_format = 'json' logforward.netstr_host = '127.0.0.1' logforward.netstr_port = 23458 logforward.netstr_message_filter = 'foo|bar|baz' # match any of the foo, bar or baz logforward.netstr_funcname_filter = 'exec_simple_query' # filter on function calling ereport call (list) logforward.netstr_format = 'netstr' Note that you need to copy the shared library also to $libdir/plugins if you are planning to use local_preload_libraries instead of shared_preload_libraries.