<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt"><div style="" class="">confirm a6d843f7ad7d1dbf1fefb6f12432e54941a680a9<br style=""><br style="" class="">Hi all,<br style="" class="">I want to use syslog-ng to log the messages generated by my application implemented in C language. I added this in the code:<br style="" class=""><br style="" class="">&nbsp;&nbsp;&nbsp; char&nbsp;&nbsp;&nbsp; *log="rtcd";<br style="" class="">&nbsp;&nbsp;&nbsp; printf("[%s] RTC adjustement\n",__func__);<br style="" class="">&nbsp;&nbsp;&nbsp; openlog(log, LOG_PID, LOG_LOCAL0);<br style="" class="">&nbsp;&nbsp;&nbsp; syslog(LOG_DEBUG, "[FIJ] RTC adjustement");<br style="" class="">&nbsp;&nbsp;&nbsp; closelog();<br style="" class=""><br style="" class=""><br style="" class="">For me, according to the syslog-ng file, the files /var/log/ldb/GENTrace.log,
 /var/log/ldb/SUTrace.log, /var/log/ldb/WANTrace.log and /var/log/ldb/CPLTrace.log must be created and must contain the syslog message.<br style="" class="">But I got no messages in my destination files. You can see the content of my syslog-ng.conf file bellow.<br style="" class=""><br style="" class="">Is it the right way to log the messages sent by C program? What can explain that I got no messages in the destinations files?<br style="" class=""><br style="" class="">Concerning log file rotation, How can we manage it using syslog-ng? For example I want to have a destination file with a size maximum = 2Mo and if the size is greater than the max size, I have to save the current one and create a new one. On my system I can have max 4 files (4 x 2Mo). How can I manage this kind of rotation?<br style="" class=""><br style="" class="">Thanks in advance.<br style="" class="">Best regards,<br style="" class="">Ismael Jean FAYE <br style="" class=""><br
 style="" class="">@version: 3.5<br style="" class="">#<br style="" class=""># Syslog-ng configuration file, compatible with default Debian syslogd<br style="" class=""># installation. Originally written by anonymous (I can't find his name)<br style="" class=""># Revised, and rewrited by me (SZALAY Attila &lt;sasa@debian.org&gt;)<br style="" class=""><br style="" class=""># First, set some global options.<br style="" class="">options { chain_hostnames(off); flush_lines(0); use_dns(no); use_fqdn(no);<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp; owner("root"); group("adm"); perm(0640); stats_freq(0);<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp; bad_hostname("^gconfd$");create_dirs(yes);<br style="" class="">};<br style="" class=""><br style="" class="">########################<br style="" class=""># Sources<br style="" class="">########################<br style="" class=""><br style="" class="">source s_mysource { <br style=""
 class="">&nbsp;&nbsp;&nbsp; pipe("/tmp/pipe" pad_size(2048));<br style="" class="">};<br style="" class=""><br style="" class="">########################<br style="" class=""># Destinations<br style="" class="">########################<br style="" class=""><br style="" class="">destination d_GEN { <br style="" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; file("/var/log/ldb/GENTrace.log");<br style="" class="">};<br style="" class=""><br style="" class="">destination d_SU { <br style="" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; file("/var/log/ldb/SUTrace.log");<br style="" class="">};<br style="" class=""><br style="" class="">destination d_WAN { <br style="" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; file("/var/log/ldb/WANTrace.log");<br style="" class="">};<br style="" class=""><br style="" class="">destination
 d_CPL { <br style="" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; file("/var/log/ldb/CPLTrace.log");<br style="" class="">};<br style="" class=""><br style="" class="">########################<br style="" class=""># Filters<br style="" class="">########################<br style="" class=""><br style="" class="">#filter f_GEN { <br style="" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; #facility(local0) and filter(nom_du_composant_applicatif);<br style="" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; #facility(local0) and filter(f_debug);<br style="" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; #facility(local0);<br style="" class="">#};<br style="" class=""><br style="" class="">filter f_SU { <br style="" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp;&nbsp; #facility(local0) and filter(nom_du_composant_applicatif);<br style="" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; #facility(local0) and filter(f_debug);<br style="" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; facility(local0);<br style="" class="">};<br style="" class=""><br style="" class="">filter f_WAN { <br style="" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; #facility(local0) and filter(nom_du_composant_applicatif);<br style="" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; #facility(local0) and filter(f_debug);<br style="" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; facility(local0);<br style="" class="">};<br style="" class=""><br style="" class="">filter f_CPL { <br style=""
 class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; #facility(local0) and filter(nom_du_composant_applicatif);<br style="" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; #facility(local0) and filter(f_debug);<br style="" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; facility(local0);<br style="" class="">};<br style="" class=""><br style="" class="">########################<br style="" class=""># Log paths<br style="" class="">########################<br style="" class=""><br style="" class="">#log { source(s_mysource); filter(f_GEN); destination(d_GEN); };<br style="" class="">log { source(s_mysource); filter(f_SU); destination(d_SU); };<br style="" class="">log { source(s_mysource); filter(f_WAN); destination(d_WAN); };<br style="" class="">log { source(s_mysource); filter(f_CPL); destination(d_CPL); };<br style="" class=""><br
 style="" class=""></div></div></body></html>