Skip to content

Commit

Permalink
Merge pull request #320 from solarwinds/NH-70772-add-filehandler-form…
Browse files Browse the repository at this point in the history
…atter

NH-70772 Add formatter to rotatingfilehandler
  • Loading branch information
tammy-baylis-swi authored Feb 21, 2024
2 parents aafe7cc + 2c6555a commit 498af3e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions solarwinds_apm/apm_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ def set_sw_log_type(log_type, log_filepath=""):
maxBytes=0,
backupCount=0,
)
file_formatter = logging.Formatter(
"%(asctime)s [ %(name)s %(levelname)-8s p#%(process)d.%(thread)d] %(message)s"
)
file_hander.setFormatter(file_formatter)
logger.addHandler(file_hander)
# stop logging to stream
logger.removeHandler(_stream_handler)
Expand Down

0 comments on commit 498af3e

Please sign in to comment.