Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does anyone know how to configure syslog to use millisecond timestamps in logs on Solaris 10, instead of the default 1 second resolution?

I know syslog-ng is available but I'm hoping I can just set some configuration with the existing syslog process.

Thanks for any help. NickB

share|improve this question

migrated from Dec 22 '09 at 15:11

This question came from our site for professional and enthusiast programmers.

up vote 1 down vote accepted

The stock Solaris syslogd does not support millisecond timestamps. You'll need to use an alternative syslogd package (like syslog-ng) if you want this.

share|improve this answer

I don't think so. If you're trying to debug some timing issue, then syslog may not be the right way to do that. However, if you're writing your own code, then you could include the time in the message portion of a syslog(3C) call (or from the shell, logger(1)). The log entry would still be on the whole second, but the message would contain the fractional part (although precision probably wouldn't be great if you're doing it from a shell script).

Maybe something along the lines of this:

// use gettimeofday(3C) to get microseconds (availability is hardware dependent)
syslog(LOG_INFO|LOG_LOCAL0, "Program foo timestamp: %d", microseconds);
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.