feat(logging): Implement database logging with app_log table

- Created migration to set up app_log table for storing application logs.
- Added AppLog entity and repository for ORM handling of logs.
- Developed DbLogger service to persist logs of level WARNING and above to the database while maintaining existing logging behavior.
- Implemented tests for admin log retrieval and DbLogger functionality to ensure proper logging behavior.
- Enhanced logging context sanitization for better error tracking.
This commit is contained in:
hamed
2026-06-29 20:01:03 +03:30
parent 830f7e8d0c
commit 803196108c
38 changed files with 3284 additions and 618 deletions
+62 -22
View File
@@ -1,7 +1,7 @@
{
"assets/admin/App.tsx": {
"mtime": 1782400063.6389112,
"ast_hash": "2f0a7050be8ada2f7008f4aae236f703",
"mtime": 1782750328.975341,
"ast_hash": "496200a3a353f2057d3a37621f80aa07",
"semantic_hash": ""
},
"assets/admin/components/FreeVisitPrice.tsx": {
@@ -30,8 +30,8 @@
"semantic_hash": ""
},
"assets/admin/components/layout/Sidebar.tsx": {
"mtime": 1782400092.7212493,
"ast_hash": "02cce7c3b866abb5b4db9944beab3b6b",
"mtime": 1782750354.360757,
"ast_hash": "1e0b143a269672d9e611f4e702dd8cac",
"semantic_hash": ""
},
"assets/admin/components/layout/Topbar.tsx": {
@@ -400,8 +400,8 @@
"semantic_hash": ""
},
"assets/admin/types/index.ts": {
"mtime": 1782222413.7646248,
"ast_hash": "478d7eddb5720c5479cecc351e04db5a",
"mtime": 1782750264.645306,
"ast_hash": "61c032545f706815210d6f66b080bdae",
"semantic_hash": ""
},
"assets/app.js": {
@@ -810,8 +810,8 @@
"semantic_hash": ""
},
"src/Admin/Controller/AdminApiController.php": {
"mtime": 1782728407.188377,
"ast_hash": "d0fb995cfa2841c3abd52a2c61ab2936",
"mtime": 1782750165.3401215,
"ast_hash": "09658d49a5db4c963fdbb7a167c8a38f",
"semantic_hash": ""
},
"src/Admin/Controller/AdminController.php": {
@@ -1370,8 +1370,8 @@
"semantic_hash": ""
},
"src/Payment/Gateway/MellatGateway.php": {
"mtime": 1781591920.5083737,
"ast_hash": "a4452ebb35de07a6fb274b66bcde6d48",
"mtime": 1782750018.5149405,
"ast_hash": "0f96d01c7e17a2894388f74825a232b3",
"semantic_hash": ""
},
"src/Payment/Gateway/MockGateway.php": {
@@ -1395,8 +1395,8 @@
"semantic_hash": ""
},
"src/Payment/Gateway/SepGateway.php": {
"mtime": 1781591920.5088227,
"ast_hash": "071ad614e25b59f22b91d69f885539a2",
"mtime": 1782750047.5329745,
"ast_hash": "c08e78093b3efe725e6798c81bf63dd2",
"semantic_hash": ""
},
"src/Payment/Repository/PaymentRepository.php": {
@@ -1580,8 +1580,8 @@
"semantic_hash": ""
},
"src/Shared/Service/ApiIrService.php": {
"mtime": 1782403597.5695918,
"ast_hash": "727088b0f129f6841af82a3f616af47b",
"mtime": 1782750061.8790064,
"ast_hash": "5fb80e5fce2191b2ece9385cf295b983",
"semantic_hash": ""
},
"src/Shared/Service/FileValidatorService.php": {
@@ -1650,13 +1650,13 @@
"semantic_hash": ""
},
"src/Sms/Provider/KavehNegarProvider.php": {
"mtime": 1782748838.317826,
"ast_hash": "b014a73717612d8c6196b21513a6a460",
"mtime": 1782749956.4059756,
"ast_hash": "fd66bf9a71b06d16beebf133d8f8a847",
"semantic_hash": ""
},
"src/Sms/Provider/RanginehProvider.php": {
"mtime": 1782748853.3315036,
"ast_hash": "6ddebcd3c562b18563b270e3624819d5",
"mtime": 1782749977.7460625,
"ast_hash": "386ef07ebd18747e614e717a86447adf",
"semantic_hash": ""
},
"src/Sms/Provider/SmsProviderInterface.php": {
@@ -2300,8 +2300,8 @@
"semantic_hash": ""
},
"config/services.yaml": {
"mtime": 1782399435.1211493,
"ast_hash": "b915f22d2fa1213be06732b639b8e00e",
"mtime": 1782749831.6264865,
"ast_hash": "e2fbe3625e44dc10f140933838278ac1",
"semantic_hash": ""
},
"docs/Architecture_Audit.md": {
@@ -2340,8 +2340,8 @@
"semantic_hash": ""
},
"docs/api/admin.md": {
"mtime": 1782728407.10617,
"ast_hash": "05cd1f677bf970d48e78b6d022ca81a6",
"mtime": 1782750435.7712955,
"ast_hash": "6a68974b5f71e8d4104ffea4cab99edf",
"semantic_hash": ""
},
"docs/api/appointment-settings.md": {
@@ -3373,5 +3373,45 @@
"mtime": 1782732335.2708814,
"ast_hash": "935e36360352c12270b34ff25e66c483",
"semantic_hash": ""
},
"assets/admin/pages/LogsPage.tsx": {
"mtime": 1782750290.0145962,
"ast_hash": "76db47af844faf3459083afa2ded8aaf",
"semantic_hash": ""
},
"migrations/Version20260629161536.php": {
"mtime": 1782749766.4726315,
"ast_hash": "74fdeef99f76b3951b5d420e1655d929",
"semantic_hash": ""
},
"src/Shared/Logging/AppLog.php": {
"mtime": 1782749711.1944597,
"ast_hash": "9089bd9d329d30edade338cb47fd4822",
"semantic_hash": ""
},
"src/Shared/Logging/AppLogRepository.php": {
"mtime": 1782749721.788873,
"ast_hash": "b0bba22cca2483a041b2c719812d7729",
"semantic_hash": ""
},
"src/Shared/Logging/DbLogger.php": {
"mtime": 1782749810.2277756,
"ast_hash": "15a0793868378a0fd1af918944b2e61e",
"semantic_hash": ""
},
"tests/Admin/AdminLogsTest.php": {
"mtime": 1782750195.979033,
"ast_hash": "6622637d75fe6e5fc81b9c9236f03191",
"semantic_hash": ""
},
"tests/Shared/DbLoggerTest.php": {
"mtime": 1782749879.1659822,
"ast_hash": "c09d6d560c768e4d78753c425a7d6f92",
"semantic_hash": ""
},
".claude/prompt/project-wide-logging.md": {
"mtime": 1782749549.9584448,
"ast_hash": "6e005bb338617608a0441724126a5bd3",
"semantic_hash": ""
}
}