Files
Aislo/docs/wiki/concepts/db_schema/logs_monitoring.md
T
eomsangdonandClaude Opus 5 eb30b774f8 chore(docs): docs 폴더 git 추적 전환 · PLAN·OWNERS 최상위 이관
- `docs/` 를 .gitignore 에서 빼 git 추적 대상으로 전환 (위키·완료 이력·검증 기록)
- `docs/raw/PLAN.md` · `docs/raw/OWNERS.md` 를 저장소 최상위로 이동 후 .gitignore 에 등록
  — 창끼리 공유하되 저장소에는 안 올리는 장부
- 살아 있는 경로 참조 7개 파일 정정 (아카이브 107건은 그때 사실이라 그대로 둠)
- graphify 날짜별 산출물(`docs/wiki/graphify-out/20*/`) 제외 — `graphify update` 가 다시 만듦

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-09 18:19:07 +09:00

5.4 KiB

type, status, related_pages, last_updated, source
type status related_pages last_updated source
concept stable
B01_Dashboard/B01_backend
architecture/shared_resources
2026-07-19 raw/guidelines/db_schema.md, raw/guidelines/backend.md, docs/raw/verification/2026-07-12_verify_add_phase4_role.md

DB: 로그/모니터링 테이블

db_schema/overview

login_logs (로그인 시도 로그)

컬럼 타입 Null Key Default / Extra
id bigint(20) NO PRI auto_increment
user_id int(11) YES MUL FK→users.id
email varchar(255) NO
status enum('SUCCESS','FAILURE') NO
failure_reason / user_agent varchar(100) / text YES
login_at timestamp NO MUL current_timestamp()

activity_logs (사용자 활동 로그)

컬럼 타입 Null Key Default / Extra
id bigint(20) NO PRI auto_increment
user_id int(11) NO MUL FK→users.id
action_type varchar(100) NO 행위 종류
action_at timestamp NO current_timestamp()
resource_id / status varchar(255) / enum - 리소스 ID / SUCCESS|FAILURE
details longtext YES JSON 상세 데이터

audit_logs (감사 로그)

컬럼 타입 Null Key Default / Extra
id int(11) NO PRI auto_increment
user_id int(11) YES MUL FK→users.id
action / entity_type varchar(100) YES CRUD/EXPORT/DOWNLOAD 등
entity_id varchar(36) YES 대상 UUID 등
timestamp / ip_address timestamp / varchar(45) - 발생시각 / IP 주소
details longtext YES JSON 상세

system_audit_logs (프로젝트/조직 변경 감사 로그)

컬럼 타입 Null Key Default / Extra
id int(11) NO PRI auto_increment
user_id int(11) NO MUL FK→users.id (행위자)
action / resource_type varchar(50) - PROJECT_CREATE 등 / 종류
resource_id int(11) YES
timestamp timestamp YES MUL current_timestamp()
ip_address / user_agent varchar(50) / text YES IP 주소 / 브라우저 에이전트

system_admin_logs (시스템 관리자 행위 로그)

컬럼 타입 Null Key Default / Extra
id bigint(20) NO PRI auto_increment
admin_user_id int(11) NO MUL FK→users.id (관리자 ID)
action_type / target_id varchar(100) / varchar(255) - 변경종류(USER_STATUS) / 대상 ID
action_at timestamp NO current_timestamp()
details longtext YES JSON 형태의 변경 상세

system_resources (시스템 자원 계측)

컬럼 타입 Null Key Default / Extra
id int(11) NO PRI auto_increment
timestamp timestamp YES MUL current_timestamp()
cpu_usage_percent / memory_usage_percent float YES
disk_usage_percent / total_storage_mb float - 디스크사용률 / 전체 스토리지 용량
active_user_count / active_project_count int(11) NO 활성 사용자 / 프로젝트 수

support_requests (기술 지원 요청)

실 DB 대조 및 A08 백엔드 코드와 100% 정합함 확인 완료 (계획 당시의 user_id/title 컬럼 스펙은 폐기됨).

컬럼 타입 Null Key Default / Extra
id int(11) NO PRI auto_increment
company_id int(11) YES MUL FK→companies.id
company_name / user_name varchar(255) - 회사명 / 작성자명
user_email / user_phone varchar(255) / varchar(30) - 이메일 / 전화번호
subject / message varchar(255) / text NO 제목 / 문의 메시지 본문
status enum('NEW','REVIEWED','RESOLVED','DELETED') NO MUL NEW
reviewed_by int(11) YES MUL FK→users.id (검토자)
created_at / reviewed_at / review_notes - - 접수 / 검토일시 / 메모

change_logs (설계 변경 이력)

컬럼 타입 Null Key Default / Extra
id int(11) NO PRI auto_increment
project_id char(36) NO FK→projects.id
changed_by int(11) YES MUL FK→users.id (수정자)
changed_at timestamp NO current_timestamp()
entity_type / entity_id varchar(100) / int(11) YES 대상엔티티(routes 등) / 대상 PK
old_value / new_value longtext YES 변경 전 / 후 JSON 스냅샷
reason varchar(255) YES 변경 사유
사용처: [[B01_Dashboard/B01_backend B01_Dashboard]] (리소스·로그 섹션), [[A08_Support/A08_backend A08_Support]] (support_requests INSERT)

system_audit_logs — 사용처 (B01, B02)

  • 프로젝트 생성: B02_ProjRegister_Repository.py:92 (PROJECT_CREATE 기록 ➡️ B02_ProjRegister/B02_backend)
  • 기타 관리 행위: B01_Dashboard_Repository.py:245,265 (수정·삭제), :336 (회사 생성), :609 (감사 로그 조회), :758 (자동화 제어)

리소스 API (SYSTEM_ADMIN 전용)

GET /api/dashboard/admin/resources?days=30 (실시간 계측 current, 30일 다운샘플링 시계열 history 및 활성 지표 stats 제공)