I have the program that prints to STDOUT some debug info. I need to run this program like daemon (with the help of nohup). To see debug info I need to add strings from STDOUT to syslog, i.e. ./program | ./to-syslog some-regexp-to-filter-input.
The question is are there some standard solutions for this problem?
The syslog() function will write information to the syslog, if that's what you want.
man syslog
Add the syslog call to your existing C code. You don't need to pipe data. If it's only for debug purposes, you can system() a sed call to do the regex filtering - without having to write a sed-like clone.
you might use "logger" for this, I have no experience with logging STDOUT to logger but this may be something worth to give it a look.