mod log subp
This commit is contained in:
@@ -41,6 +41,13 @@ class CurrentClients:
|
||||
stderr=subprocess.PIPE,
|
||||
text=True
|
||||
)
|
||||
'''
|
||||
for line in process.stdout:
|
||||
logging.info(f"Subtask stdout: {line.strip()}")
|
||||
|
||||
for line in process.stderr:
|
||||
logging.error(f"Subtask stderr: {line.strip()}")
|
||||
'''
|
||||
self.active_clients_pids[client] = process.pid
|
||||
logging.info(f"Started process for {client}, PID: {process.pid}")
|
||||
|
||||
@@ -114,6 +121,7 @@ def main():
|
||||
level=args.log_level
|
||||
)
|
||||
|
||||
|
||||
auth = {'username': args.username, 'password': get_credentials(args)}
|
||||
cur_clients = CurrentClients(args)
|
||||
userdata = {'args': args, 'cur_clients': cur_clients, 'auth': auth}
|
||||
|
||||
@@ -3,6 +3,7 @@ import argparse
|
||||
import requests
|
||||
import psycopg2
|
||||
import json
|
||||
import sys
|
||||
import os
|
||||
import logging
|
||||
|
||||
@@ -111,9 +112,9 @@ def main():
|
||||
args = parser.parse_args()
|
||||
|
||||
logging.basicConfig(
|
||||
format="%(asctime)s - PID: %(process)d %(levelname)8s: %(message)s ",
|
||||
format="- PID: %(process)d %(levelname)8s: %(message)s ",
|
||||
level=args.log_level,
|
||||
filename=f"/var/log/{args.client.removesuffix('_ase')}_receiver.log"
|
||||
stream=sys.stderr
|
||||
)
|
||||
init_db(args)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user