Skip to content

Commit

Permalink
ref: add config file for structlog
Browse files Browse the repository at this point in the history
  • Loading branch information
souvikg10 committed Oct 31, 2023
1 parent 1be1c7d commit 10d9a65
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions rasa/utils/log_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,20 @@ def configure_structlog(
"""Configure logging of the server."""
if logging_config_file is not None:
configure_logging_from_file(logging_config_file)
else:
logging.basicConfig(
format="%(message)s",
stream=sys.stdout,
level=log_level,
)

if log_level is None: # Log level NOTSET is 0 so we use `is None` here
log_level_name = os.environ.get(ENV_LOG_LEVEL, DEFAULT_LOG_LEVEL)
# Change log level from str to int (note that log_level in function parameter
# int already, coming from CLI argparse parameter).
log_level = logging.getLevelName(log_level_name)

#logging.basicConfig(
# format="%(message)s",
# stream=sys.stdout,
# level=log_level,
#)


shared_processors = [
_anonymizer,
Expand Down

0 comments on commit 10d9a65

Please sign in to comment.