Forums

Covering OroCommerce, OroCRM, OroPlatform topics, including community updates and company announcements.

Forums OroCRM How to add text to the beginning of the line about the work of the consumer?

This topic contains 3 replies, has 2 voices, and was last updated by  Makheshvara 1 month ago.

  • Creator
    Topic
  • #37857

    Makheshvara
    Participant

    Hi everyone,

    The full title does not fit into the restrictions:

    How to add text to the beginning of the line about the work of the consumer (display information in the console)?

    I was faced with a situation where I need to add a specific text to the beginning of each report, for example, a “test”. (logging and console display – logging)

    I met an interesting article, but there is another file that I need. I need to change the file a bit – Logger.php . If I understand correctly, there is a link to the file – JsonFormatter. (article – https://symfony.com/doc/2.8/logging/formatter.html)

    He suits me, and I don’t need to change this. I need only Logger.php, which is one or two hierarchies higher. (if I am not mistaken – vendor/monolog/monolog/src/Monolog/Logger.php)

    If you look at “vendor”, then I know that I need to add text, for example, in the variable “level” (level is such a multicolored text that determines the importance of the message)

    But if you know, advise how to correctly redefine to offend Logger.php

    Any advice or suggestion will be important.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #37891
    Yevhen Shyshkin
    Yevhen Shyshkin
    Moderator

    Hello, Makheshvara.

    Unfortunately, PHP does not provide a possibility to modify parent class structure. :) But there are two alternative approaches.

    1) You may extend required logger class and use it in application configuration instead of the standard one – this way you’ll override it on a global level.

    2) You may override standard console formatter and console handler to implement custom logic you need for CLI only.

    #37899

    Makheshvara
    Participant

    Thanks for the reply, Vadim.

    I will definitely try.

    Perhaps this topic can be closed. [Resolved]

    #37902

    Makheshvara
    Participant

    Amendment.

    I apologize for the gross typo. The day was very difficult.

    “Thanks for the advice, Yevhen Shyshkin”

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

You will be redirected to [title]. Would you like to continue?

Yes No
sso for www.magecore.comsso for oroinc.comsso for oroinc.desso for oroinc.fr