Errors are now being logged to the file home-assistant.log
This commit is contained in:
parent
2758d81525
commit
24b2fba170
3 changed files with 13 additions and 2 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
|||
home-assistant.log
|
||||
home-assistant.conf
|
||||
known_devices.csv
|
||||
|
||||
|
|
|
@ -13,8 +13,6 @@ import datetime as dt
|
|||
|
||||
import homeassistant.util as util
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
|
||||
MATCH_ALL = '*'
|
||||
|
||||
DOMAIN = "homeassistant"
|
||||
|
|
|
@ -15,6 +15,18 @@ def from_config_file(config_path):
|
|||
""" Starts home assistant with all possible functionality
|
||||
based on a config file. """
|
||||
|
||||
# Setup the logging for home assistant.
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
|
||||
# Log errors to a file
|
||||
err_handler = logging.FileHandler("home-assistant.log", mode='w')
|
||||
err_handler.setLevel(logging.ERROR)
|
||||
err_handler.setFormatter(
|
||||
logging.Formatter('%(asctime)s %(name)s: %(message)s',
|
||||
datefmt='%H:%M %d-%m-%y'))
|
||||
logging.getLogger('').addHandler(err_handler)
|
||||
|
||||
# Start the actual bootstrapping
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
statusses = []
|
||||
|
|
Loading…
Add table
Reference in a new issue