Skip to content

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

@asrekik

Description

@asrekik

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions