-
-
Notifications
You must be signed in to change notification settings - Fork 136
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
AppendOutputTo Not working on version 2.2 #309
Comments
Hello, could you paste code to reproduce the issue?
|
This is the file in the "tasks" folder: run("php index.php batch run 'Used_size calculate'"); $task ->in('/var/www/html/SA/V1') ->daily() ->at('2:00') ->description('Calcula Ocupação de espaço em disco') ->preventOverlapping() ->appendOutputTo('/var/www/html/SA/V1/Batch/logs/3_Used_size.log'); // IMPORTANT: You must return the schedule object return $schedule; In the Definition.php I changed: ->scalarNode('timezone') ->defaultValue('America/Sao_Paulo') ->info('Timezone used to calculate task run date') ->end() My CRON: # CRUNZ * * * * * root cd /var/www/html/SA/V1/Batch && vendor/bin/crunz schedule:run /var/www/html/SA/V1/Batch/tasks If you need more info please let me know. Thanks |
Sorry by the previous comment , now I arranged the text ... This is the file in the "tasks" folder: In the Definition.php I changed:
My CRON:
If you need more info please let me know. Thanks |
Don't mind about the folder 'SA' and 'StartArq' they are the same , I took the job from production and the cron from dev. |
We're just using crunz for the first time and ran into this as well. Had to downgrade to We're not doing anything crazy at the moment yet, we were just trying to test out the logging feature to make sure it would work for us. Here's what we're trying -- our business logic removed, however, for clarity.
|
I can confirm bug in |
@PabloKowalczyk any progress on this? I'm running protected function start(Event $event): void
{
$this->logger = $this->loggerFactory
->create()
;
// if sendOutputTo or appendOutputTo have been specified
if (!$event->nullOutput()) {
// if sendOutputTo then truncate the log file if it exists
if (!$event->shouldAppendOutput) {
$f = @\fopen($event->output, 'r+');
if (false !== $f) {
\ftruncate($f, 0);
\fclose($f);
}
}
// Create an instance of the Logger specific to the event
$event->logger = $this->loggerFactory->create();
}
$this->consoleLogger
->debug("Invoke Event's ping before.");
$this->pingBefore($event);
// Running the before-callbacks
$event->outputStream = ($this->invoke($event->beforeCallbacks()));
$event->start();
} As of 3f7c8f5, I also can't tell how that would work with the new What's more, I don't see how we could do that, since we don't have access to the data necessary data to call |
Sorry, completely missed that one! |
Fixed by #361, thanks @SalvadorCastello. |
Crunz version: 2.2
PHP version: 7.2.31
Operating system type and version:
Ubuntu 16.04
Description
After upgrading from Crunz 1.12, tasks stoped writing to log files.
I installed Crunz 2.1 and it is writing log again.
Is there any new configuration to use "AppendOutputTo" ?
Thanks
The text was updated successfully, but these errors were encountered: