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

log to stdout instead of stderr #16

Closed
yayitswei opened this Issue Oct 2, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@yayitswei
Copy link

yayitswei commented Oct 2, 2017

Thanks for making supercronic! I've found it useful so far.

One issue I'd like to fix in my setup is that after installing supercronic, my messages are now showing up in stderr instad of stdout. Any ideas why this might be happening?

@krallin

This comment has been minimized.

Copy link
Member

krallin commented Oct 3, 2017

Hi there,

Supercronic itself logs to stderr, so it's expected that you'd see output there. Note that the log output from Supercronic actually includes the stream (stdout / stderr) that sent a message:

time="2017-10-03T07:41:57Z" level=info
msg="I, [2017-10-03T07:41:56.893591 #4264]  INFO -- : Some message!"
channel=stdout iteration=3131 job.command="rake doit" job.position=3 job.schedule="*/5 * * * *"

(see channel=stdout above)

Depending on how you're processing / storing these logs, you might also want to enable the JSON output mode, which is of course easier to post-process.

Cheers,

@krallin krallin closed this Oct 3, 2017

@yayitswei yayitswei changed the title remove warning for longer jobs log to stdout instead of stderr Oct 4, 2017

@yayitswei

This comment has been minimized.

Copy link

yayitswei commented Oct 4, 2017

Thanks for the reply, I'll look into JSON output mode. Just curious, what's the reason for logging to stderr instead of stdout?

@krallin

This comment has been minimized.

Copy link
Member

krallin commented Oct 4, 2017

stdout is typically for the output of commands, whereas stderr is typically used for logging / informational message, so it normally makes sense to route logs to stderr.

That said, Supercronic doesn't really have any meaningful output to speak of, so I guess you could go with either one.... Supercronic simply happens to go with stderr.

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