cloudfoundry-community / cf-helper-php

Cloudfoundry helper in php
MIT License
18 stars 10 forks source link

The log messages are written in the same line ( no line break after each message) #6

Open asrekik opened 7 years ago

asrekik commented 7 years ago

Hello I would like to thank you for this library. It is very helpful. However, using the component logger, I noticed that all messages are written in the same line and no line break are added to the end of line.

Here is the code

$log = \CfCommunity\CfHelper\CfHelper;:getInstance()->getLogger();
$log->error("-- 1 -- Log message using the CloudFoundryLogger class ");
$log->error("-- 2 -- Log message using the CloudFoundryLogger class ");
$log->error("-- 3 -- Log message using the CloudFoundryLogger class ");

Here is the result log in the pivotal plateform

OUT 13:31:54 httpd   | [Tue Nov 14 13:31:54.948542 2017] [proxy_fcgi:error] [pid 51:tid 139866079753984] [client 172.16.1.2:57638] AH01071: Got error 'PHP message: PHP Notice:  Undefined index: CfCommunity\\CfHelper\\CfHe
lper in lib/vendor/sphring/sphring/src/Arthurh/Sphring/Runner/SphringRunner.php on line 62\nPHP message: [2017-11-14 13:31:54] CloudFoundry Helper.ERROR: -- 1 -- Log message using the CloudFoundryLogger class  [] []\nPHP message: [2017-11-14 13:31
:54] CloudFoundry Helper.ERROR: -- 2 -- Log message using the CloudFoundryLogger class  [] []\nPHP message: [2017-11-14 13:31:54] CloudFoundry Helper.ERROR: -- 3 -- Log message using the CloudFoundryLogger class  [] []\n'

And I would like to have

OUT 13:31:54 httpd   | [Tue Nov 14 13:31:54.948542 2017] [proxy_fcgi:error] [pid 51:tid 139866079753984] [client 172.16.1.2:57638] AH01071: Got error 'PHP message: PHP Notice:  Undefined index: CfCommunity\\CfHelper\\CfHe
lper in lib/vendor/sphring/sphring/src/Arthurh/Sphring/Runner/SphringRunner.php on line 62
PHP message: [2017-11-14 13:31:54] CloudFoundry Helper.ERROR: -- 1 -- Log message using the CloudFoundryLogger class  [] []
PHP message: [2017-11-14 13:31:54] CloudFoundry Helper.ERROR: -- 2 -- Log message using the CloudFoundryLogger class  [] []
PHP message: [2017-11-14 13:31:54] CloudFoundry Helper.ERROR: -- 3 -- Log message using the CloudFoundryLogger class  [] []\n'
ArthurHlt commented 7 years ago

I'm preparing a v2 which remove a lot of dependencies to make project smaller, i will see it in the same time. Thank you for your report

asrekik commented 7 years ago

Ok, thanks

Le 17 nov. 2017 11:51 AM, "ArthurH" notifications@github.com a écrit :

I'm preparing a v2 which remove a lot of dependencies to make project smaller, i will see it in the same time. Thank you for your report

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cloudfoundry-community/cf-helper-php/issues/6#issuecomment-345211173, or mute the thread https://github.com/notifications/unsubscribe-auth/AgGUtBcaiumVc1jyqMJHyu_RjY6zrmz0ks5s3WUjgaJpZM4QdZUc .