<commit_before>papertrail_port = node[:papertrail][:port] or raise 'Must set papertrail port!'

# include_recipe 'apt'
# package 'libssl-dev' 

gem_package 'remote_syslog'

log_files_conf = '/etc/log_files.yml'

file log_files_conf do
  content <<-YAML
    files:
#{node[:papertrail][:log_files].map {|file| "      - #{file}" }.join("\n")}
    destination:
      host: logs.papertrailapp.com
      port: #{papertrail_port}
  YAML

  #notifies :restart, 'service[remote_syslog]', :delayed
end

file '/etc/init/remote_syslog.conf' do
  content <<-UPSTART
description "Monitor files and send to remote syslog"
start on runlevel [2345]
stop on runlevel [!2345]

respawn

pre-start exec /usr/bin/test -e #{log_files_conf}

exec /usr/local/bin/remote_syslog -D --tls
  UPSTART

  #notifies :restart, 'service[remote_syslog]', :delayed
end

execute "start remote_syslog" do
	command "/usr/bin/ruby1.8 /usr/bin/remote_syslog -D --tls"
end

#service 'remote_syslog' do
#  action :start
#  provider Chef::Provider::Service::Upstart
#end<commit_msg>Changed to boot with file now<commit_after>papertrail_port = node[:papertrail][:port] or raise 'Must set papertrail port!'

# include_recipe 'apt'
# package 'libssl-dev' 

gem_package 'remote_syslog'

log_files_conf = '/etc/log_files.yml'

file log_files_conf do
  content <<-YAML
    files:
#{node[:papertrail][:log_files].map {|file| "      - #{file}" }.join("\n")}
    destination:
      host: logs.papertrailapp.com
      port: #{papertrail_port}
  YAML

  notifies :restart, 'service[remote_syslog]', :delayed
end

file '/etc/init/remote_syslog.conf' do
  content <<-UPSTART
description "Monitor files and send to remote syslog"
start on runlevel [2345]
stop on runlevel [!2345]

respawn

pre-start exec /usr/bin/test -e #{log_files_conf}

exec /usr/local/bin/remote_syslog -D --tls
  UPSTART

  notifies :restart, 'service[remote_syslog]', :delayed
end

#execute "start remote_syslog" do
#	command "/usr/bin/ruby1.8 /usr/bin/remote_syslog -D --tls"
#end

service 'remote_syslog' do
  action :start
  provider Chef::Provider::Service::Upstart
end
{'fraction_non_alphanumeric': 0.13451412158927717, 'fraction_numerical': 0.009573958831977022, 'mean_word_length': 4.414507772020725, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1069977', 'n_tokens_mistral': 787, 'n_tokens_neox': 764, 'n_words': 188}