pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Change request - log line prefix
6+ messages / 5 participants
[nested] [flat]

* Change request - log line prefix
@ 2012-05-31 04:05 Evan Rempel <erempel@uvic.ca>
  2012-05-31 05:06 ` Re: Change request - log line prefix Tom Lane <tgl@sss.pgh.pa.us>
  2012-05-31 05:19 ` Re: Change request - log line prefix Chris Angelico <rosuav@gmail.com>
  2012-05-31 09:37 ` Re: Change request - log line prefix hubert depesz lubaczewski <depesz@depesz.com>
  0 siblings, 3 replies; 6+ messages in thread

From: Evan Rempel @ 2012-05-31 04:05 UTC (permalink / raw)
  To: pgsql-general@postgresql.org <pgsql-general@postgresql.org>

I am part of a team that fills an operational roll administering 1000+ servers and
100's of applications. Of course we need to "read" all of our logs, and must use computers to
help us. In filtering postgreSQL logs there is one thing that makes life difficult for us admins.

Nice things about the postgreSQL logs

- user definable prefix
- each log line after the prefix contains a log line status such as;
ERROR:
FATAL:
LOG:
NOTICE:
WARNING:
STATEMENT:

- the configurable compile time option to set the wrap column for the log lines.


Now for the bad things

Even when the wrap column is set to a very large value (32k) STATEMENT lines still wrap according to the line breaks in
the original SQL statement.

Wrapped line no longer have the prefix - difficult to grep the log for everything pertaining to a particular database or user

Wrapped lines no longer have the log line status - difficult to auto-ignore all NOTICE status log lines when they wrap, or
ignore all user STATEMENT lines because they almost always wrap.


In conclusion, I would like to see a logging change that included the prefix on EVERY line, and included the STATUS on every line.


Comments?

If everyone :-) is in agreement can the authors just "get it done"?

Thanks for your time.

Evan Rempel
Systems administrator
University of Victoria.


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Change request - log line prefix
  2012-05-31 04:05 Change request - log line prefix Evan Rempel <erempel@uvic.ca>
@ 2012-05-31 05:06 ` Tom Lane <tgl@sss.pgh.pa.us>
  2012-05-31 05:47   ` Re: Change request - log line prefix Evan Rempel <erempel@uvic.ca>
  2 siblings, 1 reply; 6+ messages in thread

From: Tom Lane @ 2012-05-31 05:06 UTC (permalink / raw)
  To: Evan Rempel <erempel@uvic.ca>; +Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>

Evan Rempel <erempel@uvic.ca> writes:
> Even when the wrap column is set to a very large value (32k) STATEMENT lines still wrap according to the line breaks in
> the original SQL statement.
> Wrapped line no longer have the prefix - difficult to grep the log for everything pertaining to a particular database or user
> Wrapped lines no longer have the log line status - difficult to auto-ignore all NOTICE status log lines when they wrap, or
> ignore all user STATEMENT lines because they almost always wrap.

I think your life would be better if you used CSV log format.

> In conclusion, I would like to see a logging change that included the prefix on EVERY line, and included the STATUS on every line.

This doesn't really sound like an improvement to me.  It's going to make
the logs bulkier, but they're still not automatically parseable in any
meaningful sense.  CSV is the way to go if you want machine-readable logs.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Change request - log line prefix
  2012-05-31 04:05 Change request - log line prefix Evan Rempel <erempel@uvic.ca>
  2012-05-31 05:06 ` Re: Change request - log line prefix Tom Lane <tgl@sss.pgh.pa.us>
@ 2012-05-31 05:47   ` Evan Rempel <erempel@uvic.ca>
  0 siblings, 0 replies; 6+ messages in thread

From: Evan Rempel @ 2012-05-31 05:47 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>

Can this be done to syslog destination?

Evan Rempel
Systems Administrator
University of Victoria

On 2012-05-30, at 10:37 PM, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:

> Evan Rempel <erempel@uvic.ca> writes:
>> Even when the wrap column is set to a very large value (32k) STATEMENT lines still wrap according to the line breaks in
>> the original SQL statement.
>> Wrapped line no longer have the prefix - difficult to grep the log for everything pertaining to a particular database or user
>> Wrapped lines no longer have the log line status - difficult to auto-ignore all NOTICE status log lines when they wrap, or
>> ignore all user STATEMENT lines because they almost always wrap.
> 
> I think your life would be better if you used CSV log format.
> 
>> In conclusion, I would like to see a logging change that included the prefix on EVERY line, and included the STATUS on every line.
> 
> This doesn't really sound like an improvement to me.  It's going to make
> the logs bulkier, but they're still not automatically parseable in any
> meaningful sense.  CSV is the way to go if you want machine-readable logs.
> 
>            regards, tom lane



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Change request - log line prefix
  2012-05-31 04:05 Change request - log line prefix Evan Rempel <erempel@uvic.ca>
@ 2012-05-31 05:19 ` Chris Angelico <rosuav@gmail.com>
  2012-05-31 13:54   ` Re: Change request - log line prefix Stuart Bishop <stuart@stuartbishop.net>
  2 siblings, 1 reply; 6+ messages in thread

From: Chris Angelico @ 2012-05-31 05:19 UTC (permalink / raw)
  To: pgsql-general@postgresql.org

On Thu, May 31, 2012 at 2:05 PM, Evan Rempel <erempel@uvic.ca> wrote:
> Even when the wrap column is set to a very large value (32k) STATEMENT lines still wrap according to the line breaks in
> the original SQL statement.

The problem isn't so much the wrapping, it seems, as that your
statements' line breaks are being propagated through. So as a possible
alternative solution, perhaps there could be an option to replace
newlines with spaces before the line goes to the log?

ChrisA



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Change request - log line prefix
  2012-05-31 04:05 Change request - log line prefix Evan Rempel <erempel@uvic.ca>
  2012-05-31 05:19 ` Re: Change request - log line prefix Chris Angelico <rosuav@gmail.com>
@ 2012-05-31 13:54   ` Stuart Bishop <stuart@stuartbishop.net>
  0 siblings, 0 replies; 6+ messages in thread

From: Stuart Bishop @ 2012-05-31 13:54 UTC (permalink / raw)
  To: Chris Angelico <rosuav@gmail.com>; +Cc: pgsql-general@postgresql.org

On Thu, May 31, 2012 at 12:19 PM, Chris Angelico <rosuav@gmail.com> wrote:
> On Thu, May 31, 2012 at 2:05 PM, Evan Rempel <erempel@uvic.ca> wrote:
>> Even when the wrap column is set to a very large value (32k) STATEMENT lines still wrap according to the line breaks in
>> the original SQL statement.
>
> The problem isn't so much the wrapping, it seems, as that your
> statements' line breaks are being propagated through. So as a possible
> alternative solution, perhaps there could be an option to replace
> newlines with spaces before the line goes to the log?

I'd certainly like to see this or similar (encode the querys into a
single line of ascii, lossy is ok). I like my logs both readable and
greppable.

-- 
Stuart Bishop <stuart@stuartbishop.net>
http://www.stuartbishop.net/



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Change request - log line prefix
  2012-05-31 04:05 Change request - log line prefix Evan Rempel <erempel@uvic.ca>
@ 2012-05-31 09:37 ` hubert depesz lubaczewski <depesz@depesz.com>
  2 siblings, 0 replies; 6+ messages in thread

From: hubert depesz lubaczewski @ 2012-05-31 09:37 UTC (permalink / raw)
  To: Evan Rempel <erempel@uvic.ca>; +Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>

On Wed, May 30, 2012 at 09:05:23PM -0700, Evan Rempel wrote:
> I am part of a team that fills an operational roll administering 1000+ servers and
> 100's of applications. Of course we need to "read" all of our logs, and must use computers to
> help us. In filtering postgreSQL logs there is one thing that makes life difficult for us admins.

consider using pg.grep:
http://www.depesz.com/2012/01/23/some-new-tools-for-postgresql-or-around-postgresql/

Best regards,

depesz

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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2012-05-31 13:54 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-05-31 04:05 Change request - log line prefix Evan Rempel <erempel@uvic.ca>
2012-05-31 05:06 ` Tom Lane <tgl@sss.pgh.pa.us>
2012-05-31 05:47   ` Evan Rempel <erempel@uvic.ca>
2012-05-31 05:19 ` Chris Angelico <rosuav@gmail.com>
2012-05-31 13:54   ` Stuart Bishop <stuart@stuartbishop.net>
2012-05-31 09:37 ` hubert depesz lubaczewski <depesz@depesz.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox