On Oct 11, 2009, at 10:47 AM, Jordan Brown wrote: > >> 1) Just printf them, and rely on SMF's output redirection. > >> Problem: doesn't play nice with log rotation. > >> ... >>> But how about something like this? >>> >>> void >>> log(char *fmt, ...) >>> [ reopen logfile on each write ] >> That isn't any better than just (1), because smf already gives >> each thing a log, and I'm not sure what you meant above by >> "doesn't play >> nice w/ log rotation" but those logs *are* rotated. There is a >> single entry in logadm that triggers a script that rotates all smf >> logs. > > Sorry, I assumed context from the previous discussion a few months > ago. > > The problem with log rotation is that the service has the log file > open on its stdout and stderr, and when logadm rotates logs it does > it by rename and so the open file descriptors refer to the archived > log file, *not* to the new one. The server doesn't start writing to > the new log file until it's restarted.
Ah, yes, had forgotten about that. There really just needs to be full-fledged <logfile> support added, encompassing what is there today, and also permitting any number of other logs to be declared and rotated. -Mike --- Mike Shapiro, Sun Microsystems Open Storage / Fishworks. blogs.sun.com/mws/