1830919 Members
1876 Online
110017 Solutions
New Discussion

syslog.conf`

 
Omar Alvi_1
Super Advisor

syslog.conf`

Hi,

I was configuring my syslog not to log messages in syslog.log for the ftp daemon as follows

*.info;ftpd,mail.none; /var/adm/syslog/syslog.log

I restarted the daemon using "kill -HUP `cat /var/run/syslog.pid`", however, I see that now not a single message is being logged to syslog.

How do I prevent a particular daemon from logging?

Regards,

-Alvi
5 REPLIES 5
Stefan Farrelly
Honored Contributor

Re: syslog.conf`

ftp uses the local5 field to redirect to a different logfile. You dont need to tell syslog not to log ftp messages there, simply redirect ftp messages to a new logfile. Take a look at the example below, it removes all ftp logging from syslog.log and redirects to an ftp.log

Then stop and retsart syslog;
/sbin/init.d/syslogd stop
/sbin/init.d/syslogd start

# @(#) $Revision: 74.1 $
#
# syslogd configuration file.
#
# See syslogd(1M) for information about the format of this file.
#
local5.info;mail.none /var/adm/syslog/ftp.log
mail.debug /var/adm/syslog/mail.log
*.info;mail.none /var/adm/syslog/syslog.log
*.alert /dev/console
*.alert root
*.emerg *
Im from Palmerston North, New Zealand, but somehow ended up in London...
Omar Alvi_1
Super Advisor

Re: syslog.conf`

Hi Steven,

Thanks for the help. I got syslog working as you said, but still want to make more modifications

I was wondering, is it possible to have messages for deamons not logged at all. I was having a problem with some useless bootp messages filling my syslog.log

A few queries about the config file statements.

- are we not able to have messages logged in multiple files, if so then why isn't the ftp message still logged in syslog as well.

- is this config only redirecting ftp messages? Does it come to know this due to the local5 facility, or the logfile name?

- are all daemons covered by the local5 facility?

just young and inquisitive,
-Alvi

Stefan Farrelly
Honored Contributor

Re: syslog.conf`

Hi Alvi,

To have, for example, ftp messages go to 2 logfiles simply duplicate the local5 line and add in a new logfile (or syslog.log) and it will go to both.

syslog picks up ftp messages via the local5 facility (not logfile name) and then redirects them depending on the syslog.conf file. Different daemons use different values for local5.

Take a look at /usr/include/syslog.h for a full list of local codes which various daemons use. Its not easy to know daemon is using which local values. Unless the manpage says you may need to do some testing to find out.

Cheers,

Stefan
Im from Palmerston North, New Zealand, but somehow ended up in London...
Stefan Farrelly
Honored Contributor

Re: syslog.conf`

Also take a look at;
man 3c syslog

Under the facility encodes section it tries to list which daemons use which facility, but bootpd isnt listed among them im afraid.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Omar Alvi_1
Super Advisor

Re: syslog.conf`


Ok, now i'm doing some testing. I want to know how I can simulate messages from a particular daemon or service from among the inetd services.

Can I use the logger command to simulate messages from the bootpd, ntpd, ftpd etc. daemons?

Or is there some other way to accomplish this. I hope u get my query. Restarting inetd generates messages of starting up each deamon, but the source of the logging is shown to be inetd only.

-Alvi