genecommerce / module-encryption-key-manager

Tooling to help generate and invalidate magento encryption keys
GNU Lesser General Public License v3.0
54 stars 14 forks source link

A specific log file #51

Closed WaPoNe closed 1 month ago

WaPoNe commented 1 month ago

A specific log file.

convenient commented 1 month ago

Hello @WaPoNe

Thanks for the PR, I hope you don't mind me asking.

I'm not fully sure of the benefit here, when the magento 2 application tried to move to "log levels" with specific logs for debug/system/critical to cut down on the old magento1 case of there being 20 log files written to every day. To me that ISO level system makes much more sense.

It doesn't really make much difference (in my mind) either way you're monitoring and reviewing your logs

Using a different file to separate logs, seems like it's trying to solve a problem that should be handled elsewhere, to better effect?

WaPoNe commented 1 month ago

Hello @convenient, I think it's just neater.

If the module writes logs, I simply have to check the specific log file instead of having to read and filter through more generic files like system.log or exception.log

convenient commented 1 month ago

EDIT: Never mind, i spotted the issue here https://github.com/genecommerce/module-encryption-key-manager/pull/55/commits/c1c6c66121860cf780ccd1884a4e6d7a0e833e26 the log handler level needed changed

Hello @WaPoNe

I have pulled this in and captured it in a test in #55

Most of this is looking great 👌 I can see the logs being written to the custom file just fine. I have one test at the end which is being flagged as off though

It seems that the log is being written to the custom file, as well as the system.log. I am just checking if that is the intended situation here?

Verifying that the log is not present in system.log
[2024-08-03T07:05:02.636242+00:00] main.INFO: gene encryption manager - legacy decryption {"trace_id":"29dbea682f3e24653ad5233c871848a2","trace":"|#0 vendor/magento/framework/Interception/Interceptor.php(146): Gene\\EncryptionKeyManager\\Plugin\\LogDecrypts->afterDecrypt()|#1 vendor/magento/framework/Interception/Interceptor.php(153): Magento\\Framework\\Encryption\\Encryptor\\Interceptor->Magento\\Framework\\Interception\\{closure}()|#2 generated/code/Magento/Framework/Encryption/Encryptor/Interceptor.php(23): Magento\\Framework\\Encryption\\Encryptor\\Interceptor->___callPlugins()|#3 phar://vendor/n98/magerun2-dist/n98-magerun2/src/N98/Magento/Command/Developer/DecryptCommand.php(63): Magento\\Framework\\Encryption\\Encryptor\\Interceptor->decrypt()|#4 phar://vendor/n98/magerun2-dist/n98-magerun2/vendor/symfony/console/Command/Command.php(298): N98\\Magento\\Command\\Developer\\decryptCommand->execute()|#5 phar://vendor/n98/magerun2-dist/n98-magerun2/src/N98/Magento/Command/AbstractMagentoCommand.php(249): Symfony\\Component\\Console\\Command\\Command->run()|#6 phar://vendor/n98/magerun2-dist/n98-magerun2/vendor/symfony/console/Application.php(1058): N98\\Magento\\Command\\AbstractMagentoCommand->run()|#7 phar://vendor/n98/magerun2-dist/n98-magerun2/vendor/symfony/console/Application.php(301): Symfony\\Component\\Console\\Application->doRunCommand()|#8 phar://vendor/n98/magerun2-dist/n98-magerun2/src/N98/Magento/Application.php(256): Symfony\\Component\\Console\\Application->doRun()|#9 phar://vendor/n98/magerun2-dist/n98-magerun2/vendor/symfony/console/Application.php(171): N98\\Magento\\Application->doRun()|#10 phar://vendor/n98/magerun2-dist/n98-magerun2/src/N98/Magento/Application.php(364): Symfony\\Component\\Console\\Application->run()|#11 vendor/n98/magerun2-dist/n98-magerun2(8): N98\\Magento\\Application->run()|#12 vendor/bin/n98-magerun2(120): include('...')|#13 {main}"} []
Error on line 288