kba-team / graylog-utilities
Utilities for logging
Installs: 21 881
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: ^7.4|^8.0
- psr/log: ^1.1|^3.0
Requires (Dev)
- phpunit/phpunit: ^9.5.13
README
Utilities for logging.
Usage
composer requrire kba-team/graylog-utilities
LogTypes
<?php $logTypes = new \kbATeam\GraylogUtilities\LogTypes(); $logTypes->add(\Psr\Log\LogLevel::ALERT); $logTypes->add(\Psr\Log\LogLevel::CRITICAL); var_dump($logTypes->get());
Output:
array(2) {
[0]=>
string(5) "alert"
[1]=>
string(8) "critical"
}
Obfuscator
<?php $obfuscator = new \kbATeam\GraylogUtilities\Obfuscator(); $obfuscator->addKey('password'); $data = [ 'foo' => 'bar', 'password' => 'secret' ]; var_dump($obfuscator->obfuscate($data));
Output:
array(2) {
["foo"]=>
string(3) "bar"
["password"]=>
string(6) "********"
}