2

Here's the situation: I'm working on a MFC application and want to integrate some logging capabilities into it. I did some research and settled on Pantheios since it seems to be regarded as the best logging API out there. I had no problems getting simple logging up and running - I even threw in some callback stuff to change the formatting of the output.

My application will be making use of several DLLs. These are DLLs that I am actively developing and would like to integrate logging into them as well. Ideally all the logging from these DLLs will be routed into the main application log - but I can't figure out how to do that using Pantheios. I can have them log to their own files but I can't figure out how to attach them to the main application log.

Any ideas?

dwyatt
  • 111
  • 1
  • 6
  • Okay, I figured out a way of doing it. By using the PANTHEIOS_BE_FILE_F_SHARE_ON_WINDOWS flag when setting the file path you can simply use the same file name in the application and in the DLLs and they will all write to the same file! – dwyatt Apr 19 '12 at 14:55
  • I am facing the same problems, I can log dll & main program into different log files by using pantheios, but I cannot get those logging into one logging file. Do you need to call pantheios_be_file_setFilePath again in each DLLs again ? I have tried calling pantheios_be_file_setFilePath(PSTR("C:\\TestLog2.log"),PANTHEIOS_BE_FILE_F_SHARE_ON_WINDOWS, PANTHEIOS_BE_FILE_F_SHARE_ON_WINDOWS, PANTHEIOS_BEID_ALL); only in main exe program & in dlls as well, but only main program can log to TestLog2.log file. Do you know why ? – RoundPi Apr 24 '12 at 11:56
  • Try using PANTHEIOS_BEID_LOCAL instead of PANTHEIOS_BEID_ALL in the dlls. Keep it as PANTHEIOD_BEID_ALL in the main application though. – dwyatt May 01 '12 at 15:17
  • Thanks for the info, but I have already wrote a more lightweight thread-safe/process safe logger myself. – RoundPi May 01 '12 at 16:10

0 Answers0