In my bolt-project.yaml I'm referencing to a log f...
# bolt
w
In my bolt-project.yaml I'm referencing to a log file for debug logging, but this file can get large sometimes and am wondering if there is a way to get some grip on this, by either adding a datetime stamp or make it a rolling log. Is this possible with bolt? Ideally, it would be something like this: log: /var/log/puppetlabs/bolt-server/bolt-server-<timestamp>.log: append: true level: debug And then something equivalent to $(date +\%Y_\%m_\%d). I know yaml isn't able to do this, but trying to find a way to do this.
y
With some grain of overengineering I’d maybe consider to pass the log name to a epp/erb templating engine (like a dynamic file names in rsyslog’s
omfile
), when an accompanying option is set (
log.dynamic_filename
e.g.)
or maybe just use some pre-defined %-options in the name (like PostgreSQL does)
w
Well, I was going the templating way, but as you say, for the purpose it may be a bit too much work. We have logrotate in place, so I can also manage it that way, but I prefer using built in options if they are available.
y
I have a weird workaround in my head.. but it’s really weird 😄
you can create an inventory plugin which will check the file and rotate it if it’s too big or it’s too old e.g. 😄 that plugin can return just an empty group e.g. and do literally nothing more
then every time you run bolt it’ll call the plugin which will do the trick.. though it’s a bit on a crazy side 🙂
w
Yeah, i like the idea, and might be useful if I could is for multiple projects, but for now i'll just use logrotate. Thanks for your alternative thinking.