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

Logrotation #17

Closed
keptenkurk opened this issue Sep 20, 2016 · 4 comments
Closed

Logrotation #17

keptenkurk opened this issue Sep 20, 2016 · 4 comments

Comments

@keptenkurk
Copy link
Owner

keptenkurk commented Sep 20, 2016

Rotate logfiles as they tend to become pretty big over time.
(from http://www.domoticz.com/forum/viewtopic.php?f=38&t=11305)

@remb0
Copy link

remb0 commented Sep 23, 2016

also
/var/daemon.log
because of the bleutooth logging.

@keptenkurk
Copy link
Owner Author

Well... than have a look at syslog, debug and auth.log too... they are also cluttered because of this bluetooth restarting every 10 seconds. The good thing is: all these files will be rotating and zipped already by the OS. Still it would be nicer if it were possible to keep the bluetooth running. BTW i schedule this pi to be only active an hour or so in the morning :-)

@keptenkurk
Copy link
Owner Author

With the solution of #32 and no BT adapter resets the /var/log/daemon.log is not cluttered anymore. Also by moving the log outputs in py
https://guides.github.com/features/mastering-markdown/gatt's gatttool.py scan procedure from INFO to DEBUG there will be no unwanted logging. Therefore logrotation won't be needed.

@DjZU
Copy link
Contributor

DjZU commented Apr 11, 2023

Since then I did 2 things to prevent the log to become big.

  1. Run BS440 without privileges to prevent adapter reset, as described here: blueman-applet crash solved #110
  2. Set pygatt log level to WARNING by amending BS440.py code as follows:
	plugins = {}

+++	# Set pygatt log level
+++	# INFO floods the log file with 'Starting BLE scan', 'Discovered <device>' and 'Found <devices_count> BLE devices'
+++	# Possible values: NOTSET, DEBUG, INFO, WARNING, ERROR, CRITICAL
+++	logging.getLogger('pygatt').setLevel(logging.WARNING)

	# set up logging

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

3 participants