Skip to content

Commit

Permalink
Writing logs into file is configurable from cli argument (WebOfTrust#737
Browse files Browse the repository at this point in the history
)
  • Loading branch information
s-a-tanjim authored and kentbull committed Jul 8, 2024
1 parent 53d6704 commit fd4a904
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/keri/app/cli/commands/witness/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,15 @@
parser.add_argument("--cafilepath", action="store", required=False, default=None)
parser.add_argument("--loglevel", action="store", required=False, default="CRITICAL",
help="Set log level to DEBUG | INFO | WARNING | ERROR | CRITICAL. Default is CRITICAL")
parser.add_argument("--logfile", action="store", required=False, default=None,
help="path of the log file. If not defined, logs will not be written to the file.")


def launch(args):
help.ogler.level = logging.getLevelName(args.loglevel)
help.ogler.reopen(name=args.name, temp=True, clear=True) # need to configure for logging persistent file
if(args.logfile != None):
help.ogler.headDirPath = args.logfile
help.ogler.reopen(name=args.name, temp=False, clear=True)
logger = help.ogler.getLogger()

logger.info("\n******* Starting Witness for %s listening: http/%s, tcp/%s "
Expand Down

0 comments on commit fd4a904

Please sign in to comment.