Hi there. Thank you for your opinion.<br><br>I have found that this really is a feature well needed by many embeddedsystems.<br><br>I will implement or reuse a component that makes this kind of rotation... the conclusion i got was that what I really needed was a file that would implement a buffer... so, the only way is making a daemon that does this for me.. and it may or may not save it's buffer on a destination file.
<br><br>It would be great if Linux had a driver that would do this on it's own. Or at least a driver on the project openwrt (linux for embedded systems).<br><br>Well, I have the solution now :)<br><br>Thanks you all for your contribution.
<br>Many regards,<br>Bruno.<br><br><br><br><br><br><div><span class="gmail_quote">On 17 Mar 2007 16:25:32 +0000, <b class="gmail_sendername">Bryan Henderson</b> <<a href="mailto:bryanh@giraffe-data.com">bryanh@giraffe-data.com
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">>I have a solution.. but I think there can be a better one. My solution is:
<br>>having a midlle program between syslog-ng and the destination file. And for<br>>every message received, the program would verify if the destination file<br>>(p.e. auth.log) already has 100 lines. If so, deleted the last line, make
<br>>all others one ENTER down and that append the new line to the beginning of<br>>the file.<br><br>It would probably be better to maintain the file in circular fashion:<br>allocate 8K in the beginning, then write messages from beginning to
<br>end, then wrap around and write from the beginning again, always<br>keeping track (in a header of the file) of where you last wrote. Use<br>a special program that understands this file format to translate it to<br>a regular stream that you can use normally.
<br><br>Lots of systems have programs that do this. I looked on Freshmeat for<br>a publicly available one and found 'cupyvei', though I don't much care<br>for the details of this implementation. It would be easy to write a
<br>program of your own.<br><br>I also think a built in log destination of this type<br>(e.g. "file_circular") would be an excellent addition to syslog-ng. I<br>think this type of logging is a common requirement.
<br><br>--<br>Bryan Henderson San Jose, California<br>_______________________________________________<br>syslog-ng maillist - <a href="mailto:syslog-ng@lists.balabit.hu">syslog-ng@lists.balabit.hu
</a><br><a href="https://lists.balabit.hu/mailman/listinfo/syslog-ng">https://lists.balabit.hu/mailman/listinfo/syslog-ng</a><br>Frequently asked questions at <a href="http://www.campin.net/syslog-ng/faq.html">http://www.campin.net/syslog-ng/faq.html
</a><br><br></blockquote></div><br>