Skip to content

Commit d1bcab6

Browse files
committed
feat(logging): Refactor and enhance logging framework
- Modified .env.example and config/logging.php to include new logging configuration options. - Implemented LoggerConfigurableFactory interface for standardized configuration initialization. - Created LoggerFormatterFactory to handle dynamic formatter creation based on configuration. - Enhanced LoggerHandlerFactory and LoggerProcessorFactory to dynamically create handlers and processors with configuration overrides. - Added new LoggerConfiguration methods to support dynamic and configurable log creation. - Updated LoggerFactory to utilize new factories for handler, processor, and formatter creation. - Improved LoggerRegistry to manage logger instances more effectively. - Refactored AsyncLogProcessor and created additional metric processors including CpuUsageProcessor, ExecutionTimeProcessor, and MetricsProcessor. - Renamed MemoryUsageProcessor to Metric/MemoryUsageProcessor for better organization. - Updated LoggerServiceProvider to use new factories and configuration methods. - Created ReflectionFactoryTrait to handle dynamic instance creation with constructor parameter filtering. - Added ConfigurationValidator to validate logging configurations. - Updated test cases in MemoryUsageProcessorTest and LoggerServiceProviderTest to reflect changes. - Ensured compatibility with application by updating tests/application.php.
1 parent 85dbce2 commit d1bcab6

23 files changed

+992
-232
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ PAPERTRAIL_URL=logs.papertrailapp.com
1616
PAPERTRAIL_PORT=12345
1717

1818
# Formatter para logs stderr
19-
LOG_STDERR_FORMATTER=\KaririCode\Logging\Formatter\JsonFormatter
19+
LOG_STDERR_FORMATTER=json
2020

2121
# Índice do Elasticsearch para logs
2222
ELASTIC_LOG_INDEX=logging-logs

0 commit comments

Comments
 (0)