logging changes - sample output

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: logging changes - sample output
Date: 2003-08-09 18:45:23
Message-ID: 3F354143.1050603@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


I ended up doing more or less what Bruce suggested, for 2 reasons -
first it is extensible, and second it avoids hardcoding any special
separators.

The new config variable is set like this:

log_line_format = '<%U%%%D> ' # %U=username %D=databasename %%=%

Sample output including session logging when log_connections= true:

2003-08-09 14:33:22 [14219] LOG: database system was shut down at
2003-08-09 14:33:17 EDT
2003-08-09 14:33:22 [14219] LOG: checkpoint record is at 0/27A3470
2003-08-09 14:33:22 [14219] LOG: redo record is at 0/27A3470; undo
record is at 0/0; shutdown TRUE
2003-08-09 14:33:22 [14219] LOG: next transaction id: 6235; next oid:
154553
2003-08-09 14:33:22 [14219] LOG: database system is ready
2003-08-09 14:33:35 [14222] LOG: connection received: host=localhost port=
2003-08-09 14:33:35 [14222] <andrew%adtest> LOG: connection authorized:
user=andrew database=adtest
2003-08-09 14:33:53 [14222] <andrew%adtest> LOG: query: create table
foo (x text, y text);
2003-08-09 14:34:07 [14222] <andrew%adtest> LOG: session ended:
duration: 0:00:32.807689 user=andrew database=adtest
2003-08-09 14:34:22 [14217] LOG: received fast shutdown request
2003-08-09 14:34:22 [14225] LOG: shutting down
2003-08-09 14:34:25 [14225] LOG: database system is shut down

I'll clean this up (don't think we really need microsec granularity on
session logging) and submit the patch this weekend.

cheers

andrew

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas Pflug 2003-08-09 18:48:43 Re: Batch Operations
Previous Message Andreas Pflug 2003-08-09 18:43:33 Re: getting confused parsing ACLITEMS...