Search code examples
c++cunixposixqnx

Changing syslog log path


How do I change the log path of syslog daemon during runtime? My goal is to rotate log file every filesize or date, but I don't have logrotate in QNX/POSIX.

Do I just do an edit and hope that the syslogd checks the .conf file everytime, or is there any other workaround? Thanks.

Clarification: It has to be done in C or C++, not in script and console command line, for portabality issues.


Solution

  • Answer based on some solution found on web, and also based on @bills answer, modified to suit QNX environment.

    Perform a system call for slay syslogd and perform edit to syslog.conf and system call to syslogd again.

    QNX does not supply logrotate, otherwise other than the above answer, install third party logging is another workaround, though does not fit my purpose.

    update: After some digging, QNX provides a alternative called slogger within Neutrino OS. I'll be voting for this as an answer as it is catering to QNX system