On Sat, 21 Dec 2002, shlomo solomon wrote: > On Saturday 21 December 2002 05:32, Xavier Gentoo wrote: > > > My guess would be that you shouldn't be logging into a separate logfile at > > all. See logger(1). > I don't think that's relevant. As I understand it, logger allows writing to > syslog which isnot what I want. My script checks if ADSL is up and if not > writes to a text file so that any user can check this small file and not have > to search throuh a large syslog. I know there must be lots of tools to do > this more elegantly, but I was looking for a **quick and dirty** solution. > And, aside from the permission problem, which as I already wrote, I found a > way around, it works fine. >
logger is indeed such a quick-and-dirty tool... For future reference: 1. add to syslog.conf: user.debug -/var/log/mylogs/mylog (the '-' is to prevent immediate sync, useful if you assume your system won't crash immediately, and increases the system's performance if the program is verbose) Then you can log messages with: logger "a message" or: logger -p user.debug "another message" You get the time-stamps for free. "user" is the name of a syslog facility. "debug" is the name of the lowest log level. You can have separate logs for different log levels, or one log for all the "user" messages, and one log for just the debug messages. FMs: logger(1) on how to use logger. Quite short. syslog.conf(5) on the config file of the standard syslog daemon > > > > Either way I bet the culprit here is indeed logrotate. > I still don't agree, because as I wrote before, the change in permission > occurs at **seemingly** random intervals (not when logrotate runs) and also > changes permission of all the files in the /var/log/mylogs directory. logrotate runs daily, not weekly, BTW. Maybe the script that runs the relevant service does some chmods? I recall that Mandrake's /etc/init.d/httpd use to do such unpredicatable stuff. -- Tzafrir Cohen mailto:[EMAIL PROTECTED] http://www.technion.ac.il/~tzafrir ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
