title: Ruby & Syslog & custom facility
body: <p>I am very new playing with syslog.</p>
  
  <p>We have decided to use syslog to track some special events in our Rails application.</p>
  
  <p>The problem is that I don't want to use the default <code>/var/log/system.log</code> file but use a custom one like <code>/var/log/myapp_events.log</code>.</p>
  
  <p>I see that for that I have to define my own facility in <code>/etc/syslog.conf</code> like this:</p>
  
  <pre><code>myapp_events.* /var/log/myapp_events.log
  </code></pre>
  
  <p>After restarting syslogd I see that I can play with it directly into the <strong>bash console</strong>:</p>
  
  <pre><code>syslog -s -k Facility myapp_events Message "this is my message"
  </code></pre>
  
  <p>The message appears into the <code>/var/log/myapp_events.log</code> as expected, but I cannot reproduce this behavior using the <strong>syslog ruby gem</strong>. I have tried:</p>
  
  <pre><code>require 'syslog'
  Syslog.open('myapp_events', Syslog::LOG_PID | Syslog::LOG_CONS) { |s| s.warning 'this is my message' }  # sends the message to system.log
  Syslog.open('myapp_events', Syslog::LOG_PID | Syslog::LOG_CONS, 'myapp_events') { |s| s.warning 'this is my message' }  # error because 'myapp_event' can't be converted to int.
  </code></pre>
  
  <p>I see that <code>Syslog.open</code> has a third argument which is the <strong>facility</strong> but it has to be an integer and what I have is a string.</p>
  
  <p>Any suggestion?</p>