로그 생성이 안되어 테스트 및 수정본

This commit is contained in:
2026-03-20 09:33:30 +09:00
parent 80cb9451d2
commit bb07396abf
12 changed files with 205 additions and 23 deletions

2
public/check_env.php Normal file
View File

@@ -0,0 +1,2 @@
<?php
phpinfo(INFO_ENVIRONMENT);

4
public/test.php Normal file
View File

@@ -0,0 +1,4 @@
<?php
// 웹 브라우저에서 실행해서 결과 확인
$f = @fsockopen("192.168.10.243", 6379, $e, $s, 5);
echo $f ? "Web: ✅ Redis Connection Success" : "Web: ❌ Redis Connection Failed ($s)";

29
public/test_ci_log.php Normal file
View 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>";
}

18
public/test_log.php Normal file
View File

@@ -0,0 +1,18 @@
<?php
// 간단한 테스트
$writablePath = realpath(__DIR__ . '/../writable/logs');
echo "writable/logs 경로: " . $writablePath . "<br>";
echo "writable/logs 쓰기 가능: " . (is_writable($writablePath) ? 'YES' : 'NO') . "<br>";
echo "writable/logs 소유자: ";
system("ls -ld " . $writablePath);
echo "<br>";
// 직접 파일 쓰기 테스트
$testFile = $writablePath . '/test-' . date('Y-m-d') . '.log';
$result = file_put_contents($testFile, date('Y-m-d H:i:s') . " - Direct write test\n", FILE_APPEND);
echo "직접 쓰기 결과: " . ($result !== false ? 'SUCCESS' : 'FAILED') . "<br>";
echo "테스트 파일: " . $testFile . "<br>";
if (file_exists($testFile)) {
echo "파일 내용:<pre>" . file_get_contents($testFile) . "</pre>";
}