Skip to content

Commit

Permalink
remove system log
Browse files Browse the repository at this point in the history
fix config loki mapping
improve log time
  • Loading branch information
wassfila committed Sep 14, 2024
1 parent 2df71bb commit e1dc77b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
5 changes: 2 additions & 3 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,10 @@ services:
promtail:
image: grafana/promtail:2.9.2
volumes:
- /var/log:/var/log/host
- /home/wass/share:/var/log/share
- /opt/zigbee2mqtt/data/log:/var/log/zigbee
- ./loki/promtail-config.yaml:/etc/promtail/config.yml
command: -config.file=/etc/promtail/config.yml
- ./loki/promtail-config.yaml:/mnt/config/promtail-config.yaml
command: -config.file=/mnt/config/promtail-config.yaml
networks:
- loki

Expand Down
14 changes: 7 additions & 7 deletions loki/promtail-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ clients:
- url: http://loki:3100/loki/api/v1/push

scrape_configs:
- job_name: system
static_configs:
- targets:
- localhost
labels:
job: varlogs
__path__: /var/log/host/*log
#- job_name: system
# static_configs:
# - targets:
# - localhost
# labels:
# job: varlogs
# __path__: /var/log/host/*log
- job_name: smarthome
static_configs:
- targets:
Expand Down
2 changes: 1 addition & 1 deletion py/bathroom/cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def configure_log(logger_name):
log.basicConfig( filename=logfile,
level=log_level_map[config["level"]],
format='%(asctime)s %(name)s %(levelname)-8s %(message)s',
datefmt='%d %H:%M:%S'
datefmt='%Y-%m-%d %H:%M:%S'
)
log.getLogger('').addHandler(log.StreamHandler())
log.info("====> '%s' started logging with level '%s' @ '%s'"%(logger_name,config["level"],str(datetime.datetime.utcnow())))
Expand Down
2 changes: 1 addition & 1 deletion py/hue/cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def configure_log(logger_name):
log.basicConfig( filename=logfile,
level=log_level_map[config["level"]],
format='%(asctime)s %(name)s %(levelname)-8s %(message)s',
datefmt='%d %H:%M:%S'
datefmt='%Y-%m-%d %H:%M:%S'
)
log.getLogger('').addHandler(log.StreamHandler())
log.info("====> '%s' started logging with level '%s' @ '%s'"%(logger_name,config["level"],str(datetime.datetime.utcnow())))
Expand Down

0 comments on commit e1dc77b

Please sign in to comment.