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

Feature Request: Logfile support #1

Closed
sjcliffe opened this Issue Sep 18, 2015 · 6 comments

Comments

2 participants
@sjcliffe

sjcliffe commented Sep 18, 2015

I tried running lightsd with stderr redirected to a log file which works fine in the foreground but not in the background (-d) as it seems to close the stdio file descriptors. Would it be possible to add support via the command line to specify a log file location?

Thanks & great work!

@lopter

This comment has been minimized.

Owner

lopter commented Sep 18, 2015

Yes, I can see how that would be useful!

This shouldn't be too hard, I also had the idea of supporting syslog that might even be a better solution, what do you think?

@lopter lopter self-assigned this Sep 18, 2015

@sjcliffe

This comment has been minimized.

sjcliffe commented Sep 18, 2015

Syslog would work. If you provide the ability to specify a facility then the syslog config can be used to direct it to a specific file.

@lopter

This comment has been minimized.

Owner

lopter commented Sep 18, 2015

Cool, I'll look into that then!

@lopter

This comment has been minimized.

Owner

lopter commented Sep 20, 2015

Hey @sjcliffe, I just wanted to say that I probably won't do that before early October, depending on your use case Supervisor might be a temporary solution, it's an easy solution. It's packaged on most system otherwise it can be installed in a Python virtualenv.

@sjcliffe

This comment has been minimized.

sjcliffe commented Sep 20, 2015

No problem @lopter - not really an issue, more of a nice to have in future.

@lopter

This comment has been minimized.

Owner

lopter commented Oct 20, 2015

@sjcliffe here is a patch that adds syslog supports to lightsd, in case you wanna try it.

It seems to be working fine on Linux/BSD, logs didn't show up on OS X Yosemite, but I don't see why it wouldn't work, I'm too lazy to dig into the OS X settings.

I should release that soon, with packaging for OpenWRT and dpkg, before I start working on GH-5.

@lopter lopter closed this in 8ad7007 Nov 8, 2015

lopter added a commit that referenced this issue Jul 3, 2016

Add the --syslog (-S), --syslog-facility (-F), --syslog-ident (-I) op…
…tions

-S diverts logging to syslog, supported facilities are:

- daemon;
- user;
- local0 through 7.

-I lets you tune the process identifier and defaults to lightsd
(independently of progname).

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