로그 생성이 안되어 테스트 및 수정본
This commit is contained in:
29
public/test_ci_log.php
Normal file
29
public/test_ci_log.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
// CodeIgniter 로그 테스트
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
$app = require_once FCPATH . '../app/Config/App.php';
|
||||
$paths = require_once FCPATH . '../app/Config/Paths.php';
|
||||
|
||||
// Bootstrap the application
|
||||
require_once $paths->systemDirectory . 'bootstrap.php';
|
||||
|
||||
$app = Config\Services::codeigniter();
|
||||
$app->initialize();
|
||||
|
||||
echo "ENVIRONMENT: " . ENVIRONMENT . "<br>\n";
|
||||
|
||||
// 로그 테스트
|
||||
log_message('error', '===== TEST CI LOG MESSAGE ===== ' . date('Y-m-d H:i:s'));
|
||||
echo "log_message() 호출 완료<br>\n";
|
||||
|
||||
$logFile = WRITEPATH . 'logs/log-' . date('Y-m-d') . '.log';
|
||||
echo "로그 파일: " . $logFile . "<br>\n";
|
||||
echo "로그 파일 존재: " . (file_exists($logFile) ? 'YES' : 'NO') . "<br>\n";
|
||||
|
||||
if (file_exists($logFile)) {
|
||||
echo "<pre>";
|
||||
echo "마지막 10줄:\n";
|
||||
echo shell_exec("tail -10 " . escapeshellarg($logFile));
|
||||
echo "</pre>";
|
||||
}
|
||||
Reference in New Issue
Block a user