Skip to content

Commit fd9e6c6

Browse files
committed
first commit
0 parents  commit fd9e6c6

10 files changed

+438
-0
lines changed

AUTHORS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
log_functions is written by:
2+
* Guillaume Lelarge <guillaume at lelarge dot info>
3+

COPYING

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright (c) 2012 Guillaume Lelarge
2+
3+
Permission to use, copy, modify, and distribute this software for any
4+
purpose with or without fee is hereby granted, provided that the above
5+
copyright notice and this permission notice appear in all copies.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

INSTALL

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
log_functions Install
2+
=====================
3+
4+
To install log_functions, you can untar the log_functions tarball
5+
anywhere you want.
6+
7+
You'll need to compile it. There are two ways to do that:
8+
9+
* In the PostgreSQL source code directory, inside the contrib sub-directory
10+
11+
Put the log_functions source directory inside the contrib subdirectory
12+
of PostgreSQL.
13+
Do "make", then "make install"
14+
15+
* Using pgxs
16+
17+
Do "make USE_PGXS=1", then "make USE_PGXS=1 install"
18+
19+
Once it's installed, you'll need to configure PostgreSQL to make use of it:
20+
21+
* shared_preload_libraries='log_functions'
22+
* custom_variable_classes
23+
24+
There are five optional parameters that allow you to select which logs you want:
25+
26+
* log_functions.log_declare
27+
* log_functions.log_function_begin
28+
* log_functions.log_function_end
29+
* log_functions.log_statement_begin
30+
* log_functions.log_statement_end
31+
32+
Once the configuration is done, restart PostgreSQL.
33+
34+
You can also decide to use it only from time to time. If you want to do that,
35+
you don't need to configure PostgreSQL. When you want to use it, simply execute
36+
the following SQL statement:
37+
38+
LOAD 'log_functions';
39+
40+
Then, you will be able to set the five optional parameters.

META.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "log_functions",
3+
"abstract": "Module to log functions",
4+
"description": "log_functions is a PostgreSQL module that logs each function executed.",
5+
"version": "0.1.0",
6+
"maintainer": "Guillaume Lelarge <[email protected]>",
7+
"license": {
8+
"PostgreSQL": "http://www.postgresql.org/about/licence"
9+
},
10+
"release_status": "unstable",
11+
"provides": {
12+
"log_functions": {
13+
"file": "log_functions.so",
14+
"version": "0.4.0"
15+
}
16+
},
17+
"meta-spec": {
18+
"version": "1.0.0",
19+
"url": "http://pgxn.org/meta/spec.txt"
20+
},
21+
"tags": [
22+
"function",
23+
"stored procedure",
24+
"log"
25+
],
26+
"resources": {
27+
"bugtracker": {
28+
"web": "https://github.com/gleu/log_functions/issues"
29+
},
30+
"repository": {
31+
"type": "git",
32+
"url": "git://github.com/gleu/log_functions.git",
33+
"web": "https://[email protected]/gleu/log_functions.git"
34+
}
35+
}
36+
}

Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# contrib/log_functions/Makefile
2+
3+
MODULE_big = log_functions
4+
OBJS = log_functions.o
5+
6+
ifdef USE_PGXS
7+
PG_CONFIG = pg_config
8+
PGXS := $(shell $(PG_CONFIG) --pgxs)
9+
include $(PGXS)
10+
else
11+
subdir = contrib/log_functions
12+
top_builddir = ../..
13+
include $(top_builddir)/src/Makefile.global
14+
include $(top_srcdir)/contrib/contrib-global.mk
15+
endif
16+
override CFLAGS += -DINCLUDE_PACKAGE_SUPPORT=0 -I$(top_builddir)/src/pl/plpgsql/src
17+

README

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
log_functions is a PostgreSQL module that logs each function executed.
2+
3+
Many things can be logged:
4+
* the DECLARE statement,
5+
* the BEGIN statement,
6+
* the END statement,
7+
* and the start and end of each statement in the BEGIN/END block of a function.
8+
9+
There are five optional parameters that allow you to select which logs you want:
10+
11+
* log_functions.log_declare
12+
* log_functions.log_function_begin
13+
* log_functions.log_function_end
14+
* log_functions.log_statement_begin
15+
* log_functions.log_statement_end

TODO

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
TODO
2+
====
3+

0 commit comments

Comments
 (0)