Configuring logrotate options

13 views
Skip to first unread message

Tom Rossi

unread,
Nov 16, 2012, 10:06:35 AM11/16/12
to railsmachin...@googlegroups.com
I'm not sure you can actually set the logrotate options with moonshine.  I have tried different variations, but the resulting configuration files keep having syntax issues.  I believe the plugin is looking for an array, but when setting the options in the yml it is always a string.

The following configuration will put all of the options on one line in the srv.conf file, but this throws a syntax error.  The default setup puts each option on its own line with a line in between.

:rails_logrotate:
  :options: daily missingok compress delaycompress sharedscripts

Am I missing something?

Thanks!
Tom

Josh Nichols

unread,
Nov 20, 2012, 10:03:40 PM11/20/12
to railsmachin...@googlegroups.com
Hey Tom,

:options: is expecting an array. If you check out the rails_logrotate method, it's doing:

:options => configuration[:rails_logrotate][:options] || %w(daily missingok compress delaycompress sharedscripts),

If you're doing it in moonshine.yml, you'll want:

:rails_logrotate:
  :options:
    - daily
    - missingok
    - compress
    - delaycompress
    - sharedscripts

Or you can use the %w trick if you do it from inside a manifest with configure:

# make sure this is before recipe :default_stack
configure :rails_logrotate => {:options =>  %w(daily missingok compress delaycompress sharedscripts)}

I also added some notes about this to the Wiki: https://github.com/railsmachine/moonshine/wiki/Customize-Rails'-Log-Rotation

- Josh

--
You received this message because you are subscribed to the Google Groups "Moonshine" group.
To view this discussion on the web visit https://groups.google.com/d/msg/railsmachine-moonshine/-/m7GfCOV_VpMJ.
To post to this group, send email to railsmachin...@googlegroups.com.
To unsubscribe from this group, send email to railsmachine-moon...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/railsmachine-moonshine?hl=en.

Reply all
Reply to author
Forward
0 new messages