Commit Graph

15 Commits

Author SHA1 Message Date
wolfcode
9fb8dd022a refactor(admin): improve system log middleware
- Remove unused imports and annotations- Simplify annotation reading process
- Use ReflectionClass and ReflectionMethod directly-Handle annotations using getAttributes() method
- Improve code readability and performance
2025-01-02 17:23:13 +08:00
wolfcode
3d19c8d337 refactor(admin):重构注解获取 upgrade annotations
- Replace Doctrine annotations with PHP 8.1 attributes
- Update annotation classes to use Attribute interface
- Modify attribute usage across multiple controller files
- Update composer.json to use doctrine/annotations ^2.0.0
2025-01-02 17:04:10 +08:00
wolfcode
4baa4e185d feat(admin): add system log switch and optimize log middleware
- Add APP_ADMIN_SYSTEM_LOG environment variable to control admin system logs
- Implement log switch check in SystemLog middleware
- Update .example.env file with new environment variable
2025-01-02 09:58:08 +08:00
wolfcode
7470790657 refactor(admin): optimize system log middleware
- Adjust class name construction logic in SystemLog middleware
- Simplify condition for checking controller and action existence
2024-12-09 13:55:24 +08:00
wolfcode
6616e96724 perf(middleware): optimize system log middleware for performance
- Remove redundant code for checking ignoreLog property
- Consolidate logic to check ignoreLog property in a single location
- Improve readability and maintainability of the code

Signed-off-by: wolfcode <37436228+wolf-leo@users.noreply.github.com>
2024-10-22 11:31:06 +08:00
wolfcode
dfe15f7e88 feat(admin): 新增过滤不需要记录后台日志的方法 add ignoreLog property to exclude log recording for specific actions
- Add 'ignoreLog' property to the Log controller to specify actions that should not be logged
- Implement logic in SystemLog middleware to check if the current action is in the ignoreLog list
- Skip logging for actions listed in ignoreLog, improving performance and reducing log clutter

Signed-off-by: wolfcode <37436228+wolf-leo@users.noreply.github.com>
2024-10-12 17:21:56 +08:00
wolfcode
36038516e0 fix(SystemLog): limit response content in admin middleware
Implement a limitation on the amount of response content recorded in the system logs
to avoid excessively large entries. The response is now truncated to 3000 characters,
enhancing performance and readability while still capturing essential data.
2024-09-20 09:51:17 +08:00
wolfcode
aeb3b28184 fix(SystemLog): limit response content in admin middleware
Implement a limitation on the amount of response content recorded in the system logs
to avoid excessively large entries. The response is now truncated to 3000 characters,
enhancing performance and readability while still capturing essential data.
2024-09-20 09:49:26 +08:00
wolfcode
84f0bdcc77 refactor(admin/middleware): update request type to app\Request
Change the type of the request parameter in middleware handle functions to use
app\Request instead of the plain $request. This update clarifies the expected
request object type for better type checking and autocompletion support.
2024-09-14 17:33:07 +08:00
wolfcode
ed0e14cb32 fix(admin): use direct IP retrieval for system logs
Direct IP retrieval method has been updated to improve accuracy in the admin system log.
This change involves modifying the IP address retrieval logic from considering the
`HTTP_X_FORWARDED_FOR` header to directly using the `ip()` method, potentially enhancing
the security and reliability of IP logging.
2024-08-12 15:58:23 +08:00
wolfcode
a6fd81b0ed 🚀 202405重置版 2024-05-13 11:16:20 +08:00
wolfcode
4c587572f0 Update SystemLog.php 2023-11-07 20:03:02 +08:00
wolfcode
17dad9a9f6 Update SystemLog.php 2023-11-07 17:29:33 +08:00
wolfcode
7d89af4291 日志获取注解标题 2023-11-07 17:23:22 +08:00
wolfcode
e1c3216904 init 2023-06-15 16:18:27 +08:00