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 request: handling of log messages #288

Closed
ebaauw opened this issue May 6, 2019 · 4 comments
Closed

Feature request: handling of log messages #288

ebaauw opened this issue May 6, 2019 · 4 comments

Comments

@ebaauw
Copy link
Contributor

ebaauw commented May 6, 2019

Please add the following changes to the logging:

  • Honour homebridge's -T flag to refrain from adding timestamps to log messags (as syslog already provides the timestamp);
  • Include the timestamp from syslog in the View Logs window;
  • Honour the value from the "name" key in config.json for the logging prefix. Now the first message from homebridge-config-ui-x shows the name, but the others are hardcoded to use homebridge-config-ui-x.
[5/6/2019, 8:30:10 PM] [Config] Initializing config platform...
[5/6/2019, 8:30:11 PM] [homebridge-config-ui-x] Console v4.3.0 is listening on :: port 8080
@oznu
Copy link
Member

oznu commented May 7, 2019

Hi @ebaauw,

The next release will:

  • honor the -T flag
  • populate the name from the config.json correctly when possible (application crashing is the exception to this)

I'm holding off changing the default systemd logs at this time. I currently run journalctl with -o cat which formats the QR code correctly and retains color. Unfortunately this removes the timestamps and I don't see an option to restore them.

If I use the journalctl default -o short the colour is removed and there is a lot more content added to the line:

May 07 08:34:03 homebridge-test homebridge[2772]: [Config] Initializing config platform...

Users can still manually define their logging command if they want to change the default behaviour. The following would include timestamps, but no colour:

"log": {
     "method": "custom",
     "command": "sudo -n journalctl -n 500 -o short -f -u homebridge"
}

@oznu
Copy link
Member

oznu commented May 7, 2019

4.4.0

@oznu oznu closed this as completed May 7, 2019
@ebaauw
Copy link
Contributor Author

ebaauw commented May 7, 2019

Thanks!

I'm holding off changing the default systemd logs at this time.

I thought you might be reading the syslog yourself, but, of course, it’s easier to let journalctl do the heavy lifting. I’ll do some experiments with the various options it provides.

@ebaauw
Copy link
Contributor Author

ebaauw commented May 7, 2019

The next release will:

  • honor the -T flag
  • populate the name from the config.json correctly when possible (application crashing is the exception to this)

Confirmed, works in 4.4.0. Thanks!

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