Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON Output Formatter #656

Closed
wants to merge 4 commits into from
Closed

JSON Output Formatter #656

wants to merge 4 commits into from

Conversation

mpestritto
Copy link

I'm working on a project and needed JSON for all output for log parsing.
I built a simple JSON CLI Engine that formats as follows ( using sample Procfile )

foreman start -j -f spec/resources/Procfile

Let me know any comments anyone has and I'm happy to adjust.

Thanks.

{"application_server_timestamp":"2016-11-28 22:56:45 UTC", "process_name":"echo.1", "line":"started with pid 52092"}
{"application_server_timestamp":"2016-11-28 22:56:45 UTC", "process_name":"env.1", "line":"started with pid 52093"}
{"application_server_timestamp":"2016-11-28 22:56:45 UTC", "process_name":"test.1", "line":"started with pid 52094"}
{"application_server_timestamp":"2016-11-28 22:56:45 UTC", "process_name":"utf8.1", "line":"started with pid 52095"}
{"application_server_timestamp":"2016-11-28 22:56:45 UTC", "process_name":"ps.1", "line":"started with pid 52096"}
{"application_server_timestamp":"2016-11-28 22:56:45 UTC", "process_name":"echo.1", "line":"echoing"}
{"application_server_timestamp":"2016-11-28 22:56:45 UTC", "process_name":"env.1", "line":""}
{"application_server_timestamp":"2016-11-28 22:56:45 UTC", "process_name":"test.1", "line":"testing"}
{"application_server_timestamp":"2016-11-28 22:56:45 UTC", "process_name":"ps.1", "line":"PS env var is ps.1"}
{"application_server_timestamp":"2016-11-28 22:56:45 UTC", "process_name":"ps.1", "line":"exited with code 0"}
{"application_server_timestamp":"2016-11-28 22:56:45 UTC", "process_name":"system", "line":"sending SIGTERM to all processes"}
{"application_server_timestamp":"2016-11-28 22:56:45 UTC", "process_name":"test.1", "line":"exited with code 0"}
{"application_server_timestamp":"2016-11-28 22:56:45 UTC", "process_name":"utf8.1", "line":"terminated by SIGTERM"}
{"application_server_timestamp":"2016-11-28 22:56:46 UTC", "process_name":"env.1", "line":"exited with code 0"}
{"application_server_timestamp":"2016-11-28 22:56:46 UTC", "process_name":"echo.1", "line":"exited with code 0"}
{"application_server_timestamp":"2016-11-28 22:56:45 UTC", "process_name":"echo.1", "line":"started with pid 52092"}

@mpestritto
Copy link
Author

It looks like master is failing -- I'll rebase after its fixed.

@mpestritto
Copy link
Author

@ddollar Any thoughts or feedback?

@jasonivers
Copy link

jasonivers commented Jan 20, 2017

Commit c7edf64 seems to be in the code I've pulled when updating the gem, and I've noticed the opposite problem... there is no longer a new line if ENV vars are given, which produces an incorrect file.

I've created an issue to go with this:
#664

@mpestritto
Copy link
Author

mpestritto commented Jan 23, 2017

@ddollar Is this a error you have seen before on the build server?

No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.

Can I re-trigger a rebuild ?

@mpestritto
Copy link
Author

@jasonivers Are you still seeing the issue?
I rebased from master and cleaned up the PR.

@ddollar
Copy link
Owner

ddollar commented Mar 28, 2017

@mpestritto I have reviewed the PR and while I thank you for your effort I am not going to merge it into the project. Foreman is interactive/multiplexing mode is designed to be used in development only and I'm trying to keep the feature set small and focused on just that use case.

For your production needs please consider using foreman export to write out the configuration files for a "real" production process management system.

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants