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

[Bug]: execInBackground not print in log file #16922

Open
genfish opened this issue Apr 9, 2024 · 1 comment
Open

[Bug]: execInBackground not print in log file #16922

genfish opened this issue Apr 9, 2024 · 1 comment

Comments

@genfish
Copy link

genfish commented Apr 9, 2024

Pimcore version

v11.2.2

Steps to reproduce

In Controller use:

use Pimcore\Tool\Console;
$cmd = "/usr/bin/php /project/folder/bin/console app:export-command";
Console::execInBackground($cmd, PIMCORE_LOG_DIRECTORY . DIRECTORY_SEPARATOR . "register.log");

In ExportCommand use:

namespace App\Command;

use Pimcore\Console\AbstractCommand;

use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(
	name		: 'app:export-command'
,	description	: 'Export command'
)]
class ExportCommand extends AbstractCommand
{
	protected function execute(InputInterface $input, OutputInterface $output): int
	{
		$output->writeln("Start command...");
...
		return AbstractCommand::SUCCESS;
	}
}

Actual Behavior

When I run the export command from the command line:

/usr/bin/php /project/folder/bin/console app:export-command

It shows me on the screen: "Start command...".

When I run the export command with the controller, it creates register.log file but does not write anything to it.

Expected Behavior

Instructions $output->writeln should write to the register.log file

@genfish genfish added the Bug label Apr 9, 2024
Copy link

github-actions bot commented May 3, 2024

Thanks a lot for reporting the issue. We did not consider the issue as "Pimcore:Priority", "Pimcore:ToDo" or "Pimcore:Backlog", so we're not going to work on that anytime soon. Please create a pull request to fix the issue if this is a bug report. We'll then review it as quickly as possible. If you're interested in contributing a feature, please contact us first here before creating a pull request. We'll then decide whether we'd accept it or not. Thanks for your understanding.

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

No branches or pull requests

1 participant