Archived

This forum has been archived. Please start a new discussion on GitHub.

[IceGrid] Way to do log-rolling for nodes?

I'm having some trouble coming up with a way to accomplish log-rolling of the stderr/stdout logs for the IceGrid nodes in my system. I would think that if I tried the 'easy' method of just moving and replacing the log file, that, since the file is not reopened by ICE, no logs will be written to the new file.

Any ideas on a way to accomplish this?

Comments

  • benoit
    benoit Rennes, France
    Hi,

    If you use Linux, you can use logrotate to rotate log files (note that you should the "copytruncate" option to copy and clear the file instead of moving it). If you can't use logrotate, you can copy the file and truncate it with something like "cat /dev/null > test.log".

    If these solutions are not an option, you can write your own Ice logger to correctly handle log rotation.

    Cheers,
    Benoit.