OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums 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 year, 8 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
  • #37857


    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
  • #37891
    Yevhen Shyshkin
    Yevhen Shyshkin

    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.



    Thanks for the reply, Vadim.

    I will definitely try.

    Perhaps this topic can be closed. [Resolved]




    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)

The forum ‘OroCRM’ is closed to new topics and replies.

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

Yes No