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
Last execution time for "rebuildData.php" and "rebuildPropertyStatistics.php" #832
Comments
OK this can be done fairly easy and all you need is something like:
$GLOBALS['smwgLogEventTypes'] = array(
'sqlstore-query-execution' => false,
'maintenance-script-execution' => true
$store->getLogger()->logToTable(
'maintenance-script-execution', // smw event type
'smw-maintenance-runner', // user
'rebuildData', // target
'rebuildData.php execution' // message in the log
); and Maybe if you only want to log specific runs, add a That's all you need |
This turned into a disaster. However |
I kept the main class [0] The maintenance script need to do something like: use SMW\MediaWiki\ManualEntryLogger;
public function execute() {
...
if ( $this->hasOption( 'with-log' ) ) {
$manualEntryLogger = new ManualEntryLogger ();
$manualEntryLogger->registerLoggableEventTypes( array( 'maintenance-script' => true ) );
$manualEntryLogger->log( 'maintenance-script', 'UserX', 'rebuildData', 'Some nifty comment about ...' );
} |
Tried this including also adding the global to settings and a $this->addOption but I do not get the SMW-Log back. No PHP-issues though. Never mind for now. Let's just wait till logging is cool again. |
Ah, this works, but we basically need all the other stuff back like 'NullLogger.php' etc. so we can have |
#1361 should do the trick. |
Hey, that's cool! Sorry that I was not able to get this in even with help. |
In case one does not control the server on which the cron is setup for these two scripts there is no easy way to determine if they have actually been run successfully. Thus it will be nice to have date and time information somewhere on the wiki, perhaps on "Sepecial:SMWAdmin" saying e.g. "Last time successfully run on February 19, 2015, 05:15 am".
We have this for "rebuildConceptCache.php" on the respective concept pages and this is really useful.
The text was updated successfully, but these errors were encountered: