Log extra value

Home Forums Convertigo Products Log extra value

This topic contains 6 replies, has 2 voices, and was last updated by  Gregory Vorbe 1 year, 3 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #236019

    Erwan
    Participant

    Hi

    how can I add extra field in Convertigo log like X-Forwarded-For header ?
    especially in all ERROR and WARN logs.

    Thank you

    Best Regards

    #236020

    Gregory Vorbe
    Moderator

    Hello Erwan,

    If I understand your need, you would like to add some data in ERROR or WARN level in the Log file that can be viewed through the Web Administration Console?

    QA&Support

    #236021

    Erwan
    Participant

    HI

    you would like to add some data in ERROR or WARN

    yes and if possible in all level of log

    in the Log file

    yes, because we use ElasticStack

    can be viewed through the Web Administration Console

    that could be nice but not necessarily for us

    thank you

    #236030

    Gregory Vorbe
    Moderator

    Hi Erwan,

    To add new logs in the ‘Extra’ field of Convertigo logs, do the following:

    In a sequence_JS step of each sequence or in a onTransactionStarted() of each transaction:
    org.apache.log4j.MDC.get("ContextualParameters").put("Foo", "Bar");

    To add a Header sent by client:
    org.apache.log4j.MDC.get("ContextualParameters").put("clientAgent", context.httpServletRequest.getHeader("User-Agent"));

    This only works in Convertigo Server (not in the Studio logs).

    QA&Support

    • This reply was modified 1 year, 3 months ago by  Gregory Vorbe.
    #236031

    Gregory Vorbe
    Moderator

    Erratum: This is also working in Studio’s log viewer in Administration console.

    QA&Support

    #238376

    Erwan
    Participant

    Hi, thank you for this solution.

    it’s offer a simple way to add information in logs “ContextualParameters”.

    on the other side it force me to add this code in all sequence and in all transaction

    and the information aren’t logged in a couple of first logs for each sequence and transaction.

    how configure my parameters only once to be displayed in all projects of my engine as a standard comportment ?

    I have also noticed the presence of the “ContextualParameters” “clientip=” when I use a sequence but it was missing when I use an UrlMapper.

    how force it to be always present ?

    thank you,

    Best regards

    #243381

    Gregory Vorbe
    Moderator

    Hello Erwan,

    Currently, there is no feature to configure the logs output dynamically and automatically for all the projects.
    I have officially submitted a ticket to the developers to add it.

    Concerning the ‘clientip’ log using the UrlMapper, I reproduced the symptom, this is strange.
    I am opening an issue to RnD.

    QA&Support

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.