Skip to content

Enhance Logging and Resilience Components #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 32 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
3740346
remove test git processor
walmir-silva Jul 18, 2024
71ff74b
refactor: enhance logging and resilience components
walmir-silva Jul 18, 2024
6481f9d
feat: enhance file handler error handling and add tests
walmir-silva Jul 18, 2024
55e8cc9
Refactor test suite and update configuration
walmir-silva Jul 18, 2024
4b2ab79
Refactoring and improvements to logger configuration and creation
walmir-silva Jul 19, 2024
ecd4967
Refactoring and improvements to logger system for better dependency i…
walmir-silva Jul 19, 2024
29fa8f0
update normalize psr for tests
walmir-silva Jul 22, 2024
95d576a
refactor(logging): improve AsyncLogProcessor with enhanced encapsulat…
walmir-silva Jul 22, 2024
85dbce2
Refactor and expand LoggerServiceProviderTest for 100% coverage
walmir-silva Jul 22, 2024
d1bcab6
feat(logging): Refactor and enhance logging framework
walmir-silva Jul 24, 2024
99c06a4
Refactor Logging System: Enhance Logger Handler Factory and Service P…
walmir-silva Jul 24, 2024
b946aa6
Add validation for optional log configurations
walmir-silva Jul 24, 2024
3b9fd2f
Code style fixes
walmir-silva Jul 24, 2024
c036366
feat(logging): Implement optional context parameters with thresholds
walmir-silva Jul 25, 2024
8c6629e
Refactor logging components and remove unused file
walmir-silva Jul 25, 2024
dcb466b
feat(logging): Enhance LoggerProcessorFactory to merge optional and c…
walmir-silva Jul 25, 2024
a752812
Refactor and enhance logging anonymization:
walmir-silva Jul 30, 2024
727e92b
Encapsulate log level colors within the LogLevel enum
walmir-silva Jul 31, 2024
c6ba35b
add test_config
walmir-silva Aug 5, 2024
0da0615
refactor: Migrate Slack logger implementation to use chat.postMessage
walmir-silva Aug 5, 2024
0d76049
Refactor logging configuration and update handlers
walmir-silva Sep 17, 2024
00f2289
fix: Initialize $formatter property in AbstractHandler and subclasses
walmir-silva Sep 17, 2024
bbf2f95
refactor: WebProcessor by extracting context building into a separate…
walmir-silva Sep 17, 2024
23f6c9f
refactor: improve code readability and dependency management in utili…
walmir-silva Sep 17, 2024
4a6242f
fix: resolve issues in LoggerRegistry and SlackClient tests, remove u…
walmir-silva Sep 17, 2024
f06043b
Fix and enhance unit tests for logging classes
walmir-silva Sep 18, 2024
982697a
Update logger tests and remove unused config file
walmir-silva Sep 18, 2024
18ba513
feat: add tests for introspection processor behavior
walmir-silva Sep 19, 2024
a21fbe3
chore(tests): Remove outdated test files
walmir-silva Sep 19, 2024
39235ab
Refactor: Add 'final' to classes in the 'tests' folder and other mino…
walmir-silva Sep 19, 2024
fa62914
Refactor LoggerHandlerFactory and add new test cases
walmir-silva Sep 19, 2024
98e9e7c
refactor: improve logging factories and extend test coverage
walmir-silva Sep 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@ KARIRICODE_PHP_VERSION=8.3
KARIRICODE_PHP_PORT=9303

# Canal de log padrão
LOG_CHANNEL=stack
LOG_CHANNEL=file

# Nível de log padrão
LOG_LEVEL=debug
LOG_ENCRYPTION_KEY=83302e6472acda6a8aeadf78409ceda3959994991393cdafbe23d2a46a148ba4

# URL do Webhook do Slack para logs
LOG_SLACK_WEBHOOK_URL=https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
# Slack para logs
SLACK_BOT_TOKEN=xoxb-your-bot-token-here
SLACK_CHANNEL=#your-channel-name

# URL e Porta do Papertrail
PAPERTRAIL_URL=logs.papertrailapp.com
PAPERTRAIL_PORT=12345

# Formatter para logs stderr
LOG_STDERR_FORMATTER=\KaririCode\Logging\Formatter\JsonFormatter
LOG_STDERR_FORMATTER=json

# Índice do Elasticsearch para logs
ELASTIC_LOG_INDEX=logging-logs
Expand All @@ -25,19 +27,29 @@ ELASTIC_LOG_INDEX=logging-logs
ASYNC_LOG_ENABLED=true

# Habilitar logs de consulta
QUERY_LOG_ENABLED=false
QUERY_LOG_CHANNEL=daily
QUERY_LOG_ENABLED=true
QUERY_LOG_CHANNEL=file
QUERY_LOG_THRESHOLD=100

# Habilitar logs de desempenho
PERFORMANCE_LOG_ENABLED=false
PERFORMANCE_LOG_CHANNEL=daily
PERFORMANCE_LOG_ENABLED=true
PERFORMANCE_LOG_CHANNEL=file
PERFORMANCE_LOG_THRESHOLD=1000

# Habilitar logs de erro
ERROR_LOG_ENABLED=true
ERROR_LOG_CHANNEL=daily
ERROR_LOG_CHANNEL=file

# Configurações do limpador de logs
LOG_CLEANER_ENABLED=true
LOG_CLEANER_KEEP_DAYS=30

# Configurações do CircuitBreaker
CIRCUIT_BREAKER_FAILURE_THRESHOLD=3
CIRCUIT_BREAKER_RESET_TIMEOUT=60

# Configurações do Retry
RETRY_MAX_ATTEMPTS=3
RETRY_DELAY=1000
RETRY_MULTIPLIER=2
RETRY_JITTER=100
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,7 @@ temp/
tmp/
.vscode/launch.json
.vscode/extensions.json
tests/lista_de_arquivos.php
tests/lista_de_arquivos.php
tests/lista_de_arquivos_test.php
lista_de_arquivos.txt
lista_de_arquivos_tests.txt
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Initial configurations
PHP_SERVICE := kariricode-contract
PHP_SERVICE := kariricode-logging
DC := docker-compose

# Command to execute commands inside the PHP container
Expand Down
6 changes: 1 addition & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,7 @@
"mockery/mockery": "^1.6",
"enlightn/security-checker": "^2.0"
},
"scripts": {
"post-package-install": [
"KaririCode\\Logging\\Util\\ComposerScripts::postPackageInstall"
]
},
"scripts": {},
"extra": {
"branch-alias": {
"dev-main": "1.0.x-dev"
Expand Down
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading