Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweaking the level of the log of a succeeded process #157

Open
xaviermarchegay opened this issue Jan 15, 2025 · 6 comments
Open

Tweaking the level of the log of a succeeded process #157

xaviermarchegay opened this issue Jan 15, 2025 · 6 comments

Comments

@xaviermarchegay
Copy link
Contributor

A client asked us to remove the message logged when the process is finished.

$this->processLogger->info(
"Process {$history->getProcessCode()} succeed",
[
'duration' => $history->getDuration(),
]
);

The reasoning is that when you schedule a import task every hour, chances are that there are no file to import. However, there is still an "INFO" displayed even though the task technically did not do anything at all of value.

image

The idea would be to downgrade the log to DEBUG so that the presence or not of logs in the reports columns would mean something.

image

WDYT?

@VincentChalnot
Copy link
Contributor

In my opinion if the client only wants to see the errors for his scheduled process then it means the command line in the cron (or other scheduler) should contains the --quiet (-q) flag:
https://symfony.com/doc/current/console/verbosity.html

@xaviermarchegay
Copy link
Contributor Author

@VincentChalnot In this instance, the presence of an INFO log would mean that at least one file was treated by the task. This is why they asked us to remove this specific log because "info: 1" means 0 files treated et "info: 2" means 1 file treated.

@VincentChalnot
Copy link
Contributor

The ProcessManager is not aware of what happens in each task right? Alltough I agree with you that this kind of message could be configured with a custom task according to the need of the process.

@xaviermarchegay
Copy link
Contributor Author

One proposed solution would be to be able to configure the level of the messages of the bundle (info or debug).

@VincentChalnot
Copy link
Contributor

Seems like a good compromise but adds complexity. I would advise to deprecate this and force the message as debug for the next big release.

@njoubert-cleverage
Copy link
Member

On my mind, there are 2 differents informations :

  • INFO Success at *** : says that process was cronned well and this informations must not been removed
  • [0-n] file(s) processed : missing information (or maybe it is the last column value)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants