Menu

#214 Two separate log files used, yet when logSeverity is set to 7 only one log file is generated

main - 1.0+
open-accepted
Pantheios (1)
6
2015-10-13
2015-08-04
Adam
No

On linux the CTester log only prints until the first initialization of the F4 framework, after that I believe all the logs are printed on the AsirikuyFramework.log file, even if they were generated by the CTester. This is a pantheios bug in Linux so we have to wait till they fix that within the core library.

Discussion

  • Adam

    Adam - 2015-08-04

    Hey. I am a member of Asirikuy. We use your software for logging. There is a bug that when debug setting is 7 in the config file. The log files (there are two) is truncated just into one. Issue happens only on Linux machines.

     
  • Matt Wilson

    Matt Wilson - 2015-08-08

    Hi Adam

    Are you able to post a smallest-possible example that demonstrates the behaviour. I'd be happy to take a look at that. Alternatively, can you provide more detail about how Panthieos is being configured in your project(s) and the behaviour you're witnessing.

    Matt

     
  • Adam

    Adam - 2015-08-10

    Hi Matt,

    In our programe we have two configuration files. I think ( am not an author of the solution) each of these files keeps a setup for a different logs (being generated from two shared libraries as a programme solution). Now everything works fine, till you specify debug = 7 in one of the files (two of the files). Suddenly all log outcome in generated in just one file. This is only in Linux, windows version works fine as verified by me.

    As per the exchange with one of the authors of the programme solution:


    Yes, I have re-ran it on Windows and the log files are ok there.

    Thanks! Perhaps the latest version will fix, I will be glad...

    From: Daniel Fernandez [mailto:ekans_@hotmail.com]
    Sent: 03 June 2015 19:58
    To: Adam Niedzwiecki
    Subject: RE: debug C tester log, no proper info on individual systems when running portfolio

    I don't have a bug reference but I did report it a while ago. It might take a while before it's fixed (as it's exclusive to Linux). However we aren't using the latest version of pantheios, I will update it on unstable and see if it fixes anything.


    From: aniecki@gmail.com
    To: ekans_@hotmail.com
    Subject: RE: debug C tester log, no proper info on individual systems when running portfolio
    Date: Wed, 3 Jun 2015 17:57:23 +0200
    There is always something, just when I thought I could use it on Linux nicely. Indeed when you set to debug both files than it is visible in Asirikuy but then the size of it is huuugee!

    Do you have a bug reference from Pantheios? I cannot locate it. This could take quite a time to resolve?

    From: Daniel Fernandez [mailto:ekans_@hotmail.com]
    Sent: 03 June 2015 14:55
    To: Adam Niedzwiecki
    Subject: RE: debug C tester log, no proper info on individual systems when running portfolio

    Hi Adam,

    On linux the CTester log only prints until the first initialization of the F4 framework, after that I believe all the logs are printed on the AsirikuyFramework.log file, even if they were generated by the CTester. This is a pantheios bug in Linux so we have to wait till they fix that within the core library,

    Best regards,

    Daniel


    From: aniecki@gmail.com
    To: ekans_@hotmail.com
    Subject: debug C tester log, no proper info on individual systems when running portfolio
    Date: Wed, 3 Jun 2015 13:21:39 +0200
    Hi Daniel,

    I am debugging our P20 portfolio (as a prerequisite for Markowitz opt) and have noticed that the log file (AsirikuyCTester.log) generated from the NST when logSeverity is set to 7 in the config file, contains not enough number of settings as per number of systems. There are 20 systems, yet the setting are only for 3.

    Could be a bug?

    Please let me know.

    Cheers,
    Adam


    Hope it makes sense. Let me know, perhaps you can also contact Daniel for more info.

    Cheers,
    Adam

    One of the config files attached. I can attached a second one as well, if you require.

     
  • Adam

    Adam - 2015-10-02

    Hi Matt,

    Noticed that you provided a new version of the Pantheious, perhaps you have taken care of my problem as well?

    Adam

     
  • Matt Wilson

    Matt Wilson - 2015-10-05

    Adam

    I'm really happy to address the issue, but I think the only practical way is for you to provide me with a project that demonstrates the problem. It can be as simple as 1 .cpp + 1 makefile if that shows the problem.

    Matt

     
  • Matt Wilson

    Matt Wilson - 2015-10-05
    • labels: --> Pantheios
    • status: open --> open-accepted
    • assigned_to: Matt Wilson
    • Priority: 5 --> 6
     
  • Adam

    Adam - 2015-10-05

    Hi Matt,

    I sadly don't have the time to create projects for testing this (it would take quite a while to code) but perhaps this would help you. It is caused when calling a library that writes to a pantheios log file from a program that also writes to a different pantheios log file inside the same folder.

    And that is only in Linux version with the highest severity log when debugging (in our case it is 7)

    Let me know, perhaps that will be enough for you to reproduce it.

    Cheers,
    Adam

     
  • Adam

    Adam - 2015-10-07

    Short update, as now I am testing the software.

    On Windows verified ok.

    On Linux, the problem is happening even with lower severity, we have two log files:
    1. framework
    2. tester

    these are within the same folder. Yet when the severity is set a specific level framework log is being updated with tester. data. Also the process name (the first colum) is named "[tester 1, Oct 07..." where it should be "[framework...." and this is for all the data. The log tester stops logging at about 80-90 rows. So in the end the framework file log contains both tester and framework data intermingled, but always the first column set as "[tester ..."

    Thanks,

     

    Last edit: Adam 2015-10-08
  • Matt Wilson

    Matt Wilson - 2015-10-09

    I think that's enough. I think the key is in your saying "a library that writes to a pantheios log file from a program that also writes to a different pantheios log file inside the same folder."

    I assume you mean a static library, rather than a shared object / dynamic link library. That being the case, the library and the program are part of the same link unit, and Pantheios' design is such that each link unit has a single back-end. Or, more precisely, each link-unit has a single core, which connects, via a link-time decision, to one of each of the back end API functions. Usually, these back end API functions are provided by a single stock (i.e. provided as part of Pantheios FOSS distribution) back end, such as be.file, be.fprintf, be.WindowsDebugger, etc.

    However, there are two stock back-ends - be.lrsplit and be.N - that allow multiplexing output to multiple back-ends. (See http://www.pantheios.org/tutorials_backend_splitting.html for be.lrsplit. See example in distro for be.N.)

    I'm making a strong guess that your system is using a single back end, based on be.file, and that you're calling the 1-parameter overload of pantheios_be_file_setFilePath() in two places, which explains the strange two-file behaviour.

    I suggest you consider instead using the be.N back end with several instances of be.file, each of which is given (by you) a specific back end identifier, which is then used with the 4-parameter overload of pantheios_be_file_setFilePath() and with the severity level pseudo constants' extended information (as shown in the example.cpp.misc.extended_severity_information example program).

    HTH. If that's not it, or you need something more sophisticated, I am happy to assist you with some custom development.

     
  • Adam

    Adam - 2015-10-09

    Thanks Matt.

    One important thing is to notice that it does work in Windows, affected is Linux only.

    The two projects within workspace are actually dynamic (tester and framework). The other are static, almost 20 of them in the whole solution.

    Ok, initialization in tester:

    pantheios_init();
    pantheios_be_file_setFilePath((PAN_CHAR_T)pantheiosLogPath, 0, 0, PANTHEIOS_BEID_ALL);
    pantheios_fe_simple_setSeverityCeiling(severityLevel);
    pantheios_logputs(PANTHEIOS_SEV_NOTICE, (PAN_CHAR_T
    )"Pantheios initialized.");
    pantheios_logputs(PANTHEIOS_SEV_NOTICE, (PAN_CHAR_T*)"Testerframework initialization complete.");

    Ok, initialization in framework:
    pantheios_init();
    pantheios_be_file_setFilePath((PAN_CHAR_T)pantheiosLogPath, 0, 0, PANTHEIOS_BEID_ALL);
    pantheios_fe_simple_setSeverityCeiling(config.loggingConfig.severityLevel);
    pantheios_logputs(PANTHEIOS_SEV_NOTICE, (PAN_CHAR_T
    )"Pantheios initialized.");

    Of couse, pantheiosLogPath variable is in both cases different, it contains proper file name.

    I have now played around to change to (in framwork)

    pantheios_be_file_setFilePath((PAN_CHAR_T*)pantheiosLogPath, 0, 0, 1);

    and to (in tester)

    pantheios_be_file_setFilePath((PAN_CHAR_T*)pantheiosLogPath, 0, 0, 5);

    as specified in distro example.c.N.c, but that didn't help unfortunately.

    So, not sure what is happening..

     
  • Adam

    Adam - 2015-10-10

    To complete the view - after the setting as above (so called back-end identifiers of 1 and 5) framework log is generated but with tester's first column data "[tester ...etc', but there is no tester log file. As reported, I am testing thin on Linux.

    Hope that helps to pinpoint the issue. Also I am not sure why you mentioned: severity level pseudo constants' extended information. The general 7 status severity level is more than enough for us. At least currently.

     

    Last edit: Adam 2015-10-10
  • Adam

    Adam - 2015-10-13

    Hi Matt,

    This is to give recent update.

    We have 2 shared libraries. Tester and Framework. These lib are with the loggings as specified before

    Also we have about 20 of static libraries, however some of them also use logging. Normally its logging is being logged into the Framework log.

    The end result which we use is two dynamic libraries (built in C/C++) and two log files. This works on Windows, but not on Linux as advised.

    The main program is in Python using these 2 libraries what makes it somehow more difficult for me to debug the issue, but I am trying....

    Hope you can help.

    Cheers,
    Adam

     

Log in to post a comment.