alt3 / cakebox

Framework agnostic virtual PHP Development Environment
128 stars 27 forks source link

logging added to bash files and logs appended to /var/log/cakephp/cak… #90

Closed Modicrumb closed 6 years ago

Modicrumb commented 6 years ago

Created for issue https://github.com/alt3/cakebox/issues/47

bravo-kernel commented 6 years ago

Appreciated, will try to test this weekend using a fresh install.

bravo-kernel commented 6 years ago

Just checked and the box comes up as expected (with logging as shown below).

However, like you pointed out:

Any chance the format can be changed to use LogStash?

[Fri Feb  9 08:28:33 UTC 2018] [DEBUG]  < check-ssh-agent SCRIPTEXIT
[Fri Feb  9 08:28:34 UTC 2018] [DEBUG]  > console-installer SCRIPTENTRY
[Fri Feb  9 08:28:34 UTC 2018] [INFO]  Please wait... installing Cakebox Commands and Dashboard
[Fri Feb  9 08:28:41 UTC 2018] [INFO]  * Updating Composer cache permissions
[Fri Feb  9 08:28:41 UTC 2018] [INFO]  * Creating project
[Fri Feb  9 08:29:56 UTC 2018] [INFO]  * Composer installing
[Fri Feb  9 08:33:24 UTC 2018] [INFO]  Installation completed successfully!
[Fri Feb  9 08:33:24 UTC 2018] [DEBUG]  < console-installer SCRIPTEXIT
{"@timestamp":"2018-02-09T08:33:27.387032+00:00","@source":"cakebox","@fields":{"channel":"cli.cakebox","level":100,"ctxt_scope":[]},"@message":"================================================================================","@tags":["cli.cakebox"],"@type":"cakephp"}
{"@timestamp":"2018-02-09T08:33:27.387621+00:00","@source":"cakebox","@fields":{"channel":"cli.cakebox","level":100,"ctxt_scope":[]},"@message":"Self-updating cakebox","@tags":["cli.cakebox"],"@type":"cakephp"}
{"@timestamp":"2018-02-09T08:33:27.387720+00:00","@source":"cakebox","@fields":{"channel":"cli.cakebox","level":200,"ctxt_scope":[]},"@message":"Self-updating Composer","@tags":["cli.cakebox"],"@type":"cakephp"}
{"@timestamp":"2018-02-09T08:33:27.387843+00:00","@source":"cakebox","@fields":{"channel":"cli.cakebox","level":100,"ctxt_scope":[]},"@message":"Shell command as root:`sudo composer self-update 2>&1`","@tags":["cli.cakebox"],"@type":"cakephp"}

image

Modicrumb commented 6 years ago

Yeah I would just have to change logger.sh logic, give me a week or so and I'll get this in.

bravo-kernel commented 6 years ago

That would be more than nice. No rush, these things take time.

Sent from my Mobile Device

Op 9 feb. 2018 om 18:27 heeft Richard Sacco notifications@github.com het volgende geschreven:

Yeah I would just have to change logger.sh logic, give me a week or so and I'll get this in.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

Modicrumb commented 6 years ago

Updated this PR, Logger now logs in LogStash format, my only concerns were does it matter what order the json keys are in (doubt it) and just kind of threw information in where I saw fit based on the keys.

bravo-kernel commented 6 years ago

Thanks, I will spin up a new box this weekend to test.

bravo-kernel commented 6 years ago

Just tested mr. @Modicrumb and.. the log entries are now appearing in ElasticSearch/Kibana.

Job well done, much obliged 💯

image