function elog($obj)
{
$filePath = '/var/log/php';
$date = new DateTime();
$result = file_put_contents($filePath, $date->format('[Y-m-d H:i:s] ') . var_export($obj, true) . "\n", FILE_APPEND);
if (!$result) {
error_log($filePath . 'への書き込みに失敗しました');
error_log(var_export($obj, true));
}
}
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme