Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save arbal/78f48cad8f0b5150a7a2863d77fb351f to your computer and use it in GitHub Desktop.
Save arbal/78f48cad8f0b5150a7a2863d77fb351f to your computer and use it in GitHub Desktop.
Example newsyslog configuration for rotating Rails log files on Mac OS X.
# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num]
/Users/your-username/path-your-rails-project/log/*.log your-username:staff 644 4 * $D0 GJ
# NOTES
#
# Place file in /etc/newsyslog.d
# '$D0' under 'when' tells newsyslog to rotate logs daily at midnight.
# Alternatively you could use '24' for 'when', which would specify "every 24 hours"
# '*' under 'size' specifies that logs should be rotated regardless of their size.
# 'G' under 'flags' tells newsyslog that the 'logfilename' is a pattern and it should rotate all log files matching the pattern.
# 'J' under 'flags' specifies that rotated logs should be compressed using bzip2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment