Thanks to helgatheviking comment, Go this:
1- Create "debug.log" file in "wp-content" folder: /wp-content/debug.log
2- Make sure that the "debug.log" file is writable by anyone (all users not only admin) (permission 777)
3- In main wordpress directory in "wp-config.php" file, uncomment and change:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
4- Inside the hook function or in functions.php use this code to log any variable:
error_log(json_encode($array));
5- Read /wp-content/debug.log