XMLWordPrintable

    Details

    • Type: Technical task
    • Status: Won't Fix
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: log, Qserv
    • Labels:
      None
    • Story Points:
      3
    • Sprint:
      DB_S15_05, DB_S15_06
    • Team:
      Data Access and Database

      Description

      lsst/log should be able to log application PID

        Attachments

          Issue Links

            Activity

            Hide
            jammes Fabrice Jammes added a comment -

            Two more tickets required to complete DM-2430:

            • Initialize MDC via python (for czar),
            • Study how to intialize MDC in C++ plugin (for xrootd)
            Show
            jammes Fabrice Jammes added a comment - Two more tickets required to complete DM-2430 : Initialize MDC via python (for czar), Study how to intialize MDC in C++ plugin (for xrootd)
            Hide
            salnikov Andy Salnikov added a comment -

            Fabrice, I do not quite understand requirements. I'd think that we want something like in Python logger - add special format code for format string in configuration, and that should print process ID for every message. Looking at your code it seems that a special macro has to be used on C++ side for this to work. Can you describe briefly how this is going to be used?

            Show
            salnikov Andy Salnikov added a comment - Fabrice, I do not quite understand requirements. I'd think that we want something like in Python logger - add special format code for format string in configuration, and that should print process ID for every message. Looking at your code it seems that a special macro has to be used on C++ side for this to work. Can you describe briefly how this is going to be used?
            Hide
            jammes Fabrice Jammes added a comment - - edited

            Hi Andy,

            Yes I agree with your description of requirements. I split this in 2 tickets. This one for the C++ side, and DM-2780 for the python/SWIG side. Indeed the ticket was getting pretty big due to unit test complexity, code is in the log repos.

            Show
            jammes Fabrice Jammes added a comment - - edited Hi Andy, Yes I agree with your description of requirements. I split this in 2 tickets. This one for the C++ side, and DM-2780 for the python/SWIG side. Indeed the ticket was getting pretty big due to unit test complexity, code is in the log repos.
            Hide
            salnikov Andy Salnikov added a comment -

            Fabrice, looking at this again, I'm still not sure what you are trying to do. To me it looks like C++ log already supports mechanism (MDC) that anyone can use to add PID or any other information to the logger (and I have not seen any actual request yet to provide PID in C++ logger). Frankly I do not see reason to add specialized method (we have too many macros there already) for PID only. Could we instead extend documentation to say something like:

            To log process ID information one could use MDC: e.g.:

            LOG_MDC("PID", std::to_string(getpid()));

            (which has to be done after fork()) and add corresponding formatting code to the logger configuration.

            Show
            salnikov Andy Salnikov added a comment - Fabrice, looking at this again, I'm still not sure what you are trying to do. To me it looks like C++ log already supports mechanism (MDC) that anyone can use to add PID or any other information to the logger (and I have not seen any actual request yet to provide PID in C++ logger). Frankly I do not see reason to add specialized method (we have too many macros there already) for PID only. Could we instead extend documentation to say something like: To log process ID information one could use MDC: e.g.: LOG_MDC("PID", std::to_string(getpid())); (which has to be done after fork()) and add corresponding formatting code to the logger configuration.

              People

              Assignee:
              jammes Fabrice Jammes
              Reporter:
              jammes Fabrice Jammes
              Reviewers:
              Andy Salnikov
              Watchers:
              Andy Salnikov, Fabrice Jammes, Jacek Becla, Kian-Tat Lim
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  CI Builds

                  No builds found.