Thread: --enable-syslog and Solaris 7
Hi, I'm having a strange problem with syslog and Solaris 7, and I've run out of ideas about what might be wrong. I configure postgres with --enable-syslog, and everything works fine. Configure finds syslog, so that's not a problem. In postgres.conf, I have the following: # # Syslog # #ifdef ENABLE_SYSLOG syslog = 2 # range 0-2 syslog_facility = 'LOCAL1' syslog_ident = 'postgres' #endif And, in /etc/syslog.conf, I have #Postgres logging local1.* /opt/OXRS/logs/postgres/pg.log (yes, the whitespace is tabs). Now, the strange thing is that nothing ever seems to go to the syslog daemon. If I start up syslogd with -d, it never shows anything coming from postgres, even though I have logging levels turned up. If I redirect the log to both console and logfile, I get lots of noise on the console, bit nothing in the file, so I know it's not from want of data. Any suggestion is much appreciated, because I'm stumped. I've never seen anything like this before. Thanks, A -- ---- Andrew Sullivan 87 Mowat Avenue Liberty RMS Toronto, Ontario Canada <andrew@libertyrms.com> M6K 3E3 +1 416 646 3304 x110
* Andrew Sullivan <andrew@libertyrms.com> [010830 08:54]: > Hi, > > I'm having a strange problem with syslog and Solaris 7, and I've run > out of ideas about what might be wrong. > > I configure postgres with --enable-syslog, and everything works fine. > Configure finds syslog, so that's not a problem. In postgres.conf, I > have the following: > > # > # Syslog > # > #ifdef ENABLE_SYSLOG > syslog = 2 # range 0-2 > syslog_facility = 'LOCAL1' > syslog_ident = 'postgres' > #endif > > And, in /etc/syslog.conf, I have > > #Postgres logging > > local1.* /opt/OXRS/logs/postgres/pg.log > > (yes, the whitespace is tabs). > > Now, the strange thing is that nothing ever seems to go to the syslog > daemon. If I start up syslogd with -d, it never shows anything > coming from postgres, even though I have logging levels turned up. > If I redirect the log to both console and logfile, I get lots of > noise on the console, bit nothing in the file, so I know it's not > from want of data. > > Any suggestion is much appreciated, because I'm stumped. I've never > seen anything like this before. Any chance syslogd is running up against a file limit of some kind to get the file open? And the file exists and has the correct permissions? I do know the syslog code works, I use it heavily on my UnixWare/ÓpenUNIX and FreeBSD boxen. > > Thanks, > A > > > -- > ---- > Andrew Sullivan 87 Mowat Avenue > Liberty RMS Toronto, Ontario Canada > <andrew@libertyrms.com> M6K 3E3 > +1 416 646 3304 x110 > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://www.postgresql.org/search.mpl > -- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 972-414-9812 E-Mail: ler@lerctr.org US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749
On Thu, Aug 30, 2001 at 09:07:32AM -0500, Larry Rosenman wrote: > * Andrew Sullivan <andrew@libertyrms.com> [010830 08:54]: > Any chance syslogd is running up against a file limit of some kind to > get the file open? I can't see what; this is on a little test box, and nothing else is running. > And the file exists and has the correct permissions? In desperation, I've opened it up completely, still with no joy: -rwxrwxrwx 1 root other 0 Aug 30 08:53 pg.log I also had it owned by postgres at one point. Anyway, I don't think it can be a file problem, because running syslogd with debug on doesn't show anything coming _in_ from postgres (unless I kill the server with a client connected, because that throws a FATAL exception which is caught). That suggests to me it must have something to do with the facility that postgres is sending to, or my config file. I'm really stumped. > I do know the syslog code works, I use it heavily on my > UnixWare/ÓpenUNIX and FreeBSD boxen. I've used it elsewhere, too, which is why I'm so puzzled. A -- ---- Andrew Sullivan 87 Mowat Avenue Liberty RMS Toronto, Ontario Canada <andrew@libertyrms.com> M6K 3E3 +1 416 646 3304 x110
* Andrew Sullivan <andrew@libertyrms.com> [010830 09:27]: > On Thu, Aug 30, 2001 at 09:07:32AM -0500, Larry Rosenman wrote: > > * Andrew Sullivan <andrew@libertyrms.com> [010830 08:54]: > > > Any chance syslogd is running up against a file limit of some kind to > > get the file open? > > I can't see what; this is on a little test box, and nothing else is > running. > > > And the file exists and has the correct permissions? > > In desperation, I've opened it up completely, still with no joy: > > -rwxrwxrwx 1 root other 0 Aug 30 08:53 pg.log > > I also had it owned by postgres at one point. Anyway, I don't think > it can be a file problem, because running syslogd with debug on > doesn't show anything coming _in_ from postgres (unless I kill the > server with a client connected, because that throws a FATAL exception > which is caught). That suggests to me it must have something to do > with the facility that postgres is sending to, or my config file. > I'm really stumped. > > > I do know the syslog code works, I use it heavily on my > > UnixWare/ÓpenUNIX and FreeBSD boxen. > > I've used it elsewhere, too, which is why I'm so puzzled. What about /dev/log or other means of talking from PG to the Daemon? I.E. is there another resource that is missing. I haven't used Solaris in detail in a couple of years, so I'm not sure what pieces need to be there for PG to talk to the syslogd... LER > > A > -- > ---- > Andrew Sullivan 87 Mowat Avenue > Liberty RMS Toronto, Ontario Canada > <andrew@libertyrms.com> M6K 3E3 > +1 416 646 3304 x110 -- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 972-414-9812 E-Mail: ler@lerctr.org US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749
On Jue 30 Ago 2001 10:35, Andrew Sullivan wrote: > Hi, > > I'm having a strange problem with syslog and Solaris 7, and I've run > out of ideas about what might be wrong. > > I configure postgres with --enable-syslog, and everything works fine. > Configure finds syslog, so that's not a problem. In postgres.conf, I > have the following: > > # > # Syslog > # > #ifdef ENABLE_SYSLOG > syslog = 2 # range 0-2 > syslog_facility = 'LOCAL1' > syslog_ident = 'postgres' > #endif > > And, in /etc/syslog.conf, I have > > #Postgres logging > > local1.* /opt/OXRS/logs/postgres/pg.log On Solaris, this those not work! BTW, why local1? It should be postgres (thats the ident). Try with postgres.debug (that will give you everything from debug to critic). > (yes, the whitespace is tabs). > > Now, the strange thing is that nothing ever seems to go to the syslog > daemon. If I start up syslogd with -d, it never shows anything > coming from postgres, even though I have logging levels turned up. > If I redirect the log to both console and logfile, I get lots of > noise on the console, bit nothing in the file, so I know it's not > from want of data. saludos... :-) -- Porqué usar una base de datos relacional cualquiera, si podés usar PostgreSQL? ----------------------------------------------------------------- Martín Marqués | mmarques@unl.edu.ar Programador, Administrador, DBA | Centro de Telematica Universidad Nacional del Litoral -----------------------------------------------------------------
On Thu, Aug 30, 2001 at 11:47:07AM -0300, Mart?n Marqu?s wrote: > > > > And, in /etc/syslog.conf, I have > > > > #Postgres logging > > > > local1.* /opt/OXRS/logs/postgres/pg.log > > On Solaris, this those not work! > BTW, why local1? It should be postgres (thats the ident). I thought you had to specify the facility. That's what the manpage for syslog.conf says, anyway: The selector field contains a semicolon-separated list of priority specifications of the form: facility.level [ ; facility.level ] where facility is a system facility, or comma-separated list of facilities, and level is an indication of the severity of the condition being logged. Recognized values for facility include: [user, kern, . . . local0-7 . . .] What's different about Solaris syslog (are the man pages wrong)? > Try with postgres.debug (that will give you everything from debug to critic). No luck, but thanks. A -- ---- Andrew Sullivan 87 Mowat Avenue Liberty RMS Toronto, Ontario Canada <andrew@libertyrms.com> M6K 3E3 +1 416 646 3304 x110
On Jue 30 Ago 2001 14:02, you wrote: > On Thu, Aug 30, 2001 at 11:47:07AM -0300, Mart?n Marqu?s wrote: > > > And, in /etc/syslog.conf, I have > > > > > > #Postgres logging > > > > > > local1.* /opt/OXRS/logs/postgres/pg.log > > > > On Solaris, this those not work! > > BTW, why local1? It should be postgres (thats the ident). > > I thought you had to specify the facility. That's what the manpage > for syslog.conf says, anyway: > > The selector field contains a semicolon-separated list of > priority specifications of the form: > > facility.level [ ; facility.level ] > > where facility is a system facility, or comma-separated list > of facilities, and level is an indication of the severity of > the condition being logged. Recognized values for facility > include: > > [user, kern, . . . local0-7 . . .] You are right about this: I'll show you my configuration: postgresql.conf: # # Syslog # #ifdef ENABLE_SYSLOG syslog = 1 # range 0-2 syslog_facility = 'LOCAL0' syslog_ident = 'postgres' #endif /etc/syslog.conf: local0.debug /var/log/postgresql It worked for me! > > What's different about Solaris syslog (are the man pages wrong)? Nothing, but you can't put something like this: local0.* /var/log/postgresql -- Porqué usar una base de datos relacional cualquiera, si podés usar PostgreSQL? ----------------------------------------------------------------- Martín Marqués | mmarques@unl.edu.ar Programador, Administrador, DBA | Centro de Telematica Universidad Nacional del Litoral -----------------------------------------------------------------
On Thu, Aug 30, 2001 at 06:19:53PM -0300, Mart?n Marqu?s wrote: > /etc/syslog.conf: > > local0.debug /var/log/postgresql > > It worked for me! Thanks to everyone who replied. For the archives: The tip above, and the eyes of a Solaris-guru co-worker, conspired to find the problem for me. It turns out that Solaris allows "*" for the _facility_, but not for the _priority_. On other words, "local0.*" won't work, but "local0.debug" will. Moreover, the lowest-priority messages that you want need to be the last specified; it appears that this is cumulative, so you get everything of priority debug or higher with the above entry. A -- ---- Andrew Sullivan 87 Mowat Avenue Liberty RMS Toronto, Ontario Canada <andrew@libertyrms.com> M6K 3E3 +1 416 646 3304 x110