Обсуждение: how to get logger to not break up syslog messages
Hi I'm using the syslog as my log destination. Here are the configuration settings I have: log_destination='syslog' logging_collector='off' syslog_facility='LOCAL1' syslog_ident='postgres2' The problem I'm running into is that lines are getting broken up. For example: Feb 9 07:12:50 S1 postgres2[14294]: [2-1] 2011-02-09 07:12:50.633 EST::: LOG: automatic vacuum of table "mydb.public.mydata": index scans: 1 Feb 9 07:12:50 S1 postgres2[14294]: [2-2] #011pages: 0 removed, 1773 remain Feb 9 07:12:50 S1 postgres2[14294]: [2-3] #011tuples: 1107 removed, 74884 remain Feb 9 07:12:50 S1 postgres2[14294]: [2-4] #011system usage: CPU 0.11s/0.16u sec elapsed 17.70 sec This causes problems with some other log-scanners I use. Is the problem postgres or syslog? I know syslog has a maximum message size, but it's a lot longer than what Postgres seems to use. If postgres is the issue here, is there a way to configure postgres to produce a single log message instead of spreading it across lines? Thanks
l1@nym.hush.com writes: > The problem I'm running into is that lines are getting broken up. Yup, that's intentional. > This causes problems with some other log-scanners I use. Is the > problem postgres or syslog? I know syslog has a maximum message > size, but it's a lot longer than what Postgres seems to use. syslog's limit is platform-dependent, and at least on some platforms it's pretty darn small. If you know for sure what your platform can tolerate, you can alter PG_SYSLOG_LIMIT in src/backend/utils/error/elog.c. There's no way to change it without a recompile. regards, tom lane
On 02/09/2011 09:09 AM, Tom Lane wrote: > l1@nym.hush.com writes: >> The problem I'm running into is that lines are getting broken up. > Yup, that's intentional. > >> This causes problems with some other log-scanners I use. Is the >> problem postgres or syslog? I know syslog has a maximum message >> size, but it's a lot longer than what Postgres seems to use. > syslog's limit is platform-dependent,... Would that be an argument, perhaps, for making it (yet another, sorry Josh) GUC? Cheers, Steve
Thanks! RFC5426 appears to require a minimum of 480 octets on IP V4. I don't know when that went into effect, but I have no idea whether it's implemented to spec on all the platforms postgres supports. PG_SYSLOG_LIMIT is set to 128. On Wed, 09 Feb 2011 12:09:06 -0500 Tom Lane <tgl@sss.pgh.pa.us> wrote: >l1@nym.hush.com writes: >> The problem I'm running into is that lines are getting broken >up. > >Yup, that's intentional. > >> This causes problems with some other log-scanners I use. Is the > >> problem postgres or syslog? I know syslog has a maximum message > >> size, but it's a lot longer than what Postgres seems to use. > >syslog's limit is platform-dependent, and at least on some >platforms >it's pretty darn small. If you know for sure what your platform >can tolerate, you can alter PG_SYSLOG_LIMIT in >src/backend/utils/error/elog.c. There's no way to change it >without a recompile. > > regards, tom lane