hi,
this link has some good code .. see the dr.dobbs links for better understanding[
^]
a good approach would be to create a separate class for logging say CLogger and use it through out the project. Make clogger.h and put in it all the relevant function's declarations for example the renaming of existing file 'curentlog.log' to 'oldlog1.log' when it crosses 1 mb, and the date and time functions etc. Then implement these functions in the respective .cpp file.
start by creating a single log file and see if you are able to get info written to it. Then proceed ahead.
Remember 'Google' is your best friend for everything you need .
This is also a good way to see how
singleton pattern works[
^]