1

We are using chef for infrastructure management and deployment of various system applications.

We'd like to "duplicate" some log statements so that the message is logged to the normal chef logger, plus also log it to our chat system via curl.

Is there an easy way to do this?

For example would something like this work

log "this is a log message" do
  level :info
  notifies :run, 'execute[log_to_chat]', :immediately
end

# log a message to slack via curl command
execute 'log_to_chat' do
  command 'curl ....'
  action :nothing
end

1 Answer 1

0

You wouldn't need the notification, just have two separate resources. Each does its own thing. You might want to wrap this up in a custom resource or helper method though.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .