Why csvlog logs contexts without leading tab?

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Why csvlog logs contexts without leading tab?
Date: 2012-09-19 20:15:06
Message-ID: 20120919201506.GA10424@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Had a simple function calling another function, and the final function
was doing raise log.

When I enabled normal stderr logging, with absurdly full
log_line_prefix, I got this:

#v+
a[psql] u[depesz] d[depesz] r[[local]] h[[local]] p[15444] t[2012-09-13 21:49:37 CEST] m[2012-09-13 21:49:37.840 CEST] i[SELECT] e[00000] c[505238d0.3c54] l[3] s[2012-09-13 21:49:36 CEST] v[2/2] x[0] LOG: [logged line]
a[psql] u[depesz] d[depesz] r[[local]] h[[local]] p[15444] t[2012-09-13 21:49:37 CEST] m[2012-09-13 21:49:37.840 CEST] i[SELECT] e[00000] c[505238d0.3c54] l[4] s[2012-09-13 21:49:36 CEST] v[2/2] x[0] CONTEXT: SQL statement "SELECT b()"
PL/pgSQL function a() line 1 at PERFORM
a[psql] u[depesz] d[depesz] r[[local]] h[[local]] p[15444] t[2012-09-13 21:49:37 CEST] m[2012-09-13 21:49:37.840 CEST] i[SELECT] e[00000] c[505238d0.3c54] l[5] s[2012-09-13 21:49:36 CEST] v[2/2] x[0] STATEMENT: select a();
a[psql] u[depesz] d[depesz] r[[local]] h[[local]] p[15444] t[2012-09-13 21:49:37 CEST] m[2012-09-13 21:49:37.841 CEST] i[SELECT] e[00000] c[505238d0.3c54] l[6] s[2012-09-13 21:49:36 CEST] v[2/0] x[0] LOG: duration: 1.662 ms statement: select a();
#v-

same function call, with syslog:

#v+
Sep 13 21:53:31 h3po4 postgres[16156]: [4-1] a[psql] u[depesz] d[depesz] r[[local]] h[[local]] p[16156] t[2012-09-13 21:53:31 CEST] m[2012-09-13 21:53:31.852 CEST] i[SELECT] e[00000] c[505239bb.3f1c] l[3] s[2012-09-13 21:53:31 CEST] v[2/4] x[0] LOG: [logged line]
Sep 13 21:53:31 h3po4 postgres[16156]: [4-2] a[psql] u[depesz] d[depesz] r[[local]] h[[local]] p[16156] t[2012-09-13 21:53:31 CEST] m[2012-09-13 21:53:31.852 CEST] i[SELECT] e[00000] c[505239bb.3f1c] l[4] s[2012-09-13 21:53:31 CEST] v[2/4] x[0] CONTEXT: SQL statement "SELECT b()"
Sep 13 21:53:31 h3po4 postgres[16156]: [4-3] #011PL/pgSQL function a() line 1 at PERFORM
Sep 13 21:53:31 h3po4 postgres[16156]: [4-4] a[psql] u[depesz] d[depesz] r[[local]] h[[local]] p[16156] t[2012-09-13 21:53:31 CEST] m[2012-09-13 21:53:31.852 CEST] i[SELECT] e[00000] c[505239bb.3f1c] l[5] s[2012-09-13 21:53:31 CEST] v[2/4] x[0] STATEMENT: select a();
Sep 13 21:53:31 h3po4 postgres[16156]: [5-1] a[psql] u[depesz] d[depesz] r[[local]] h[[local]] p[16156] t[2012-09-13 21:53:31 CEST] m[2012-09-13 21:53:31.852 CEST] i[SELECT] e[00000] c[505239bb.3f1c] l[6] s[2012-09-13 21:53:31 CEST] v[2/0] x[0] LOG: duration: 1.599 ms statement: select a();
#v-

Please note that the 3rd line in both examples has leading tab - either
literal tab in case of stderr log, or #011 in case of syslog.

But with csvlog, I got something different:

#v+
2012-09-13 21:51:12.642 CEST,"depesz","depesz",15673,"[local]",5052392f.3d39,3,"SELECT",2012-09-13 21:51:11 CEST,2/2,0,LOG,00000,"[logged line]",,,,,"SQL statement ""SELECT b()""
PL/pgSQL function a() line 1 at PERFORM","select a();",,,"psql"
2012-09-13 21:51:12.642 CEST,"depesz","depesz",15673,"[local]",5052392f.3d39,4,"SELECT",2012-09-13 21:51:11 CEST,2/0,0,LOG,00000,"duration: 1.561 ms statement: select a();",,,,,,,,,"psql"
#v-

There is no leading tab on the 2nd line. Why? Is it intentional, or just
an omission?

Best regards,

depesz

--
The best thing about modern society is how easy it is to avoid contact with it.
http://depesz.com/

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Lucas Clemente Vella 2012-09-19 21:37:41 Passing row set into PL/pgSQL function.
Previous Message Rafal Pietrak 2012-09-19 20:05:35 Re: foreign key from array element