title: How to configure syslog so that an applications log goes to a specific file
body: <p>I have an application <code>myapp</code> which should send log files <em>only</em> to <code>/var/log/myapp.log</code>. <code>myapp</code> is written in C++. The following sample code, sends the logs to /var/log/syslog only. My os is Linux - Ubuntu 12.04 - to be specific. I also found that my machine has rsyslog than syslog installed.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;unistd.h&gt;
  #include &lt;syslog.h&gt;
  
  int main(void) {
      openlog("myapp", LOG_PID|LOG_CONS, LOG_USER);
      syslog(LOG_INFO, "abc 10");
      closelog();
      return 0;
  }
  </code></pre>