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

Feature: suspend Homebridge service, so users can run it from Terminal #795

Closed
ebaauw opened this issue Aug 1, 2020 · 8 comments
Closed

Comments

@ebaauw
Copy link
Contributor

ebaauw commented Aug 1, 2020

Is your feature request related to a problem? Please describe:

@oznu, as you know (see #676), my plugins log extensive debug information to the Homebridge log, to aid me in analysing issues my users might raise. I really need the full Homebridge log file when running homebridge -D, from startup to the moment the issue occurs.

I appreciate your concerns about sensitive info, and understand you don't want to provide a means to download the full log file. I'm happy to instruct my users to run homebridge -D manually, capturing the output into a file. However, more and more users are using hb-service and Homebridge Config UI X and don't know how to ssh into the machine running homebridge. The tend to know how to access the Terminal from Homebridge Config UI X.

However, they cannot run homebridge -D -U /var/lib/homebridge > homebridge.log 2>&1 from the Terminal as homebridge is already running.

Describe the solution you'd like:
Could you add an option to Homebridge Config UI X to suspend the homebridge service, so a user can run homebridge manually from the Terminal?

Describe alternatives you've considered:
The only alternative I see is a really bad idea: Have my plugins log to a separate file, bypassing Homebridge's log feature.

Additional context:
See also and homebridge/homebridge#2637.

@oznu
Copy link
Member

oznu commented Aug 1, 2020

When running under hb-service there is already an option to toggle -D from the UI (that works on any platform; even windows).

https://github.com/homebridge/homebridge-raspbian-image/wiki/How-To-Enable-Debug-or-Insecure-Mode

It's also possible to set the DEBUG environment variable here.

Would an option to download the log file be enough (with appropriate warnings about potential confidential information)?

Getting Homebridge to stop I think is a lot of work - since I've programmed hb-service to do the exact opposite (attempt keep it running at all times).

@ebaauw
Copy link
Contributor Author

ebaauw commented Aug 1, 2020

Would an option to download the log file be enough (with appropriate warnings about potential confidential information)?

That was indeed my original request.

@oznu oznu closed this as completed in c2e74c6 Aug 6, 2020
@oznu
Copy link
Member

oznu commented Aug 6, 2020

@oznu
Copy link
Member

oznu commented Aug 6, 2020

image

@oznu
Copy link
Member

oznu commented Aug 6, 2020

Just updated this so the download function strips the asci colour codes. This will make it easier to read the plain text logs.

@oznu
Copy link
Member

oznu commented Aug 6, 2020

Also added the ability for a user to "truncate" their log, which they might want to do just before starting a debug run so it's nice and short.

@ebaauw
Copy link
Contributor Author

ebaauw commented Aug 7, 2020

Thanks, mate, really appreciate this! It seems to be working just fine on my installations.

Just updated this so the download function strips the asci colour codes. This will make it easier to read the plain text logs.

There's still some residual codes. I would actually prefer the log file to contain the codes: easier to scan visually for errors and warnings.

Also added the ability for a user to "truncate" their log

Is the log file still recycled or truncated automatically?

@oznu
Copy link
Member

oznu commented Aug 7, 2020

Is the log file still recycled or truncated automatically?

Yeah at 2MB. 2MB is a lot of log file.

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

No branches or pull requests

2 participants