Обсуждение: Syslog line wrapping

Поиск
Список
Период
Сортировка

Syslog line wrapping

От
Evan Rempel
Дата:
I am running Postgresql 8.3 and would like to get postgres to
NOT wrap the syslog lines. Is ther any configuration to do this.
Perhaps I can wrap them at a very large line number?

The problem is that we want a program to analyze the logs for us, and with the line breaks it
is very difficult, although not impossible, to get a program to do this.

Evan Rempel.

Re: Syslog line wrapping

От
Tom Lane
Дата:
Evan Rempel <erempel@uvic.ca> writes:
> I am running Postgresql 8.3 and would like to get postgres to
> NOT wrap the syslog lines. Is ther any configuration to do this.
> Perhaps I can wrap them at a very large line number?

The problem we're up against is explained in src/backend/utils/error/elog.c:

     * Our problem here is that many syslog implementations don't handle long
     * messages in an acceptable manner. While this function doesn't help that
     * fact, it does work around by splitting up messages into smaller pieces.

If you are fortunate enough to have a less-broken-than-average syslog
facility, you could increase the PG_SYSLOG_LIMIT constant defined there.
On the whole, though, I'd suggest not depending on syslog.  It has
other issues besides this one, like sometimes losing messages entirely.

            regards, tom lane

Re: Syslog line wrapping

От
Vladimir Rusinov
Дата:


On Fri, Sep 24, 2010 at 7:55 AM, Evan Rempel <erempel@uvic.ca> wrote:
I am running Postgresql 8.3 and would like to get postgres to
NOT wrap the syslog lines. Is ther any configuration to do this.
Perhaps I can wrap them at a very large line number?

The problem is that we want a program to analyze the logs for us, and with the line breaks it
is very difficult, although not impossible, to get a program to do this.

pgFounie handles multi-line logs easilty. You might want to check it's source to get how.
Or just use stderr logging (which is actually more stable).

--
Vladimir Rusinov
http://greenmice.info/

Re: Syslog line wrapping

От
Peter Eisentraut
Дата:
On tor, 2010-09-23 at 20:55 -0700, Evan Rempel wrote:
> I am running Postgresql 8.3 and would like to get postgres to
> NOT wrap the syslog lines. Is ther any configuration to do this.
> Perhaps I can wrap them at a very large line number?

PostgreSQL 8.4 increased the line length.