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

Log all upgrade events during upgrade #17089

Closed
MorrisJobke opened this issue Jun 23, 2015 · 8 comments
Closed

Log all upgrade events during upgrade #17089

MorrisJobke opened this issue Jun 23, 2015 · 8 comments

Comments

@MorrisJobke
Copy link
Contributor

Have a look at all the listened events in

$updater->listen('\OC\Updater', 'maintenanceEnabled', function () use($output) {
$output->writeln('<info>Turned on maintenance mode</info>');
});
$updater->listen('\OC\Updater', 'maintenanceDisabled', function () use($output) {
$output->writeln('<info>Turned off maintenance mode</info>');
});
$updater->listen('\OC\Updater', 'maintenanceActive', function () use($output) {
$output->writeln('<info>Maintenance mode is kept active</info>');
});
$updater->listen('\OC\Updater', 'updateEnd',
function () use($output, $updateStepEnabled, $self) {
$mode = $updateStepEnabled ? 'Update' : 'Update simulation';
$status = $self->upgradeFailed ? 'failed' : 'successful';
$message = "<info>$mode $status</info>";
$output->writeln($message);
});
$updater->listen('\OC\Updater', 'dbUpgrade', function () use($output) {
$output->writeln('<info>Updated database</info>');
});
$updater->listen('\OC\Updater', 'dbSimulateUpgrade', function () use($output) {
$output->writeln('<info>Checked database schema update</info>');
});
$updater->listen('\OC\Updater', 'incompatibleAppDisabled', function ($app) use($output) {
$output->writeln('<info>Disabled incompatible app: ' . $app . '</info>');
});
$updater->listen('\OC\Updater', 'thirdPartyAppDisabled', function ($app) use ($output) {
$output->writeln('<info>Disabled 3rd-party app: ' . $app . '</info>');
});
$updater->listen('\OC\Updater', 'upgradeAppStoreApp', function ($app) use($output) {
$output->writeln('<info>Update 3rd-party app: ' . $app . '</info>');
});
$updater->listen('\OC\Updater', 'repairWarning', function ($app) use($output) {
$output->writeln('<error>Repair warning: ' . $app . '</error>');
});
$updater->listen('\OC\Updater', 'repairError', function ($app) use($output) {
$output->writeln('<error>Repair error: ' . $app . '</error>');
});
$updater->listen('\OC\Updater', 'appUpgradeCheck', function () use ($output) {
$output->writeln('<info>Checked database schema update for apps</info>');
});
$updater->listen('\OC\Updater', 'appUpgrade', function ($app, $version) use ($output) {
$output->writeln("<info>Updated <$app> to $version</info>");
});
$updater->listen('\OC\Updater', 'failure', function ($message) use($output, $self) {
$output->writeln("<error>$message</error>");
$self->upgradeFailed = true;
and add listeners for this to updater class. These listeners then log everything. Then web and CLI based updates are fully logged in case of a failure and it doesn't need to rerun the upgrade with a verbose command line option.

I just came to this, because often the upgrade is run and something bad happens. Then you need to reproduce this and add all the listeners and make the upgrade verbose. Logging this directly would help a lot of people I think

Opinions on this?

@LukasReschke @nickvergessen @DeepDiver1975 @karlitschek @rullzer @jancborchardt @Xenopathic @schiesbn @icewind1991 @PVince81

@RealRancor Maybe you have interesting insights from the forum ;)

@MorrisJobke
Copy link
Contributor Author

ref #17088

@karlitschek
Copy link
Contributor

yes. completely agreed!!!

@schiessle
Copy link
Contributor

agreed, I think it makes totally sense to log this stuff. Especially for a update which is executed only once I would rather log too much than too little to have as much information as possible if something goes wrong.

@ghost
Copy link

ghost commented Jun 23, 2015

Sounds a good idea 👍

Had also some additional requests of users in the forums to make the upgrade steps more verbose as often the questions where asked like "what is the update process currently doing".

@oparoz
Copy link
Contributor

oparoz commented Jun 23, 2015

Finally! :)
This should make it much easier to quickly pinpoint where the upgrade goes wrong...

Would it be possible to change the log level to 0 and turn debug mode on in verbose mode (if it's not done already)?

@PVince81 PVince81 added this to the backlog milestone Mar 2, 2016
@PVince81
Copy link
Contributor

PVince81 commented Mar 2, 2016

@MorrisJobke didn't we add something recently that changes log level to debug then back during an upgrade ?

@MorrisJobke
Copy link
Contributor Author

@MorrisJobke didn't we add something recently that changes log level to debug then back during an upgrade ?

Yes. #19441

@MorrisJobke MorrisJobke modified the milestones: 8.2, backlog Mar 2, 2016
@lock
Copy link

lock bot commented Aug 5, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants