creating custom function to log actions in plugin

Just change the action hook to:

add_action( 'update_history', 'update_history', 10, 4 );

It will work.