Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Web UI Logging #2911

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions locust/argument_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,12 @@ def setup_parser_arguments(parser):
help="Host to bind the web interface to. Defaults to '*' (all interfaces)",
env_var="LOCUST_WEB_HOST",
)
web_ui_group.add_argument(
"--web-host-display-name",
type=str,
help=configargparse.SUPPRESS,
env_var="LOCUST_WEB_HOST_DISPLAY_NAME",
)
web_ui_group.add_argument(
"--web-port",
"-P",
Expand Down
2 changes: 2 additions & 0 deletions locust/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,8 @@ def ensure_user_class_name(config):
web_host = options.web_host
if web_host:
logger.info(f"Starting web interface at {protocol}://{web_host}:{options.web_port}")
if options.web_host_display_name:
logger.info(f"Starting web interface at {options.web_host_display_name}")
else:
if os.name == "nt":
logger.info(
Expand Down
2 changes: 1 addition & 1 deletion locust/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def handle_exception(error):
error_message = str(error)
error_code = getattr(error, "code", 500)
logger.log(
logging.INFO if error_code <= 404 else logging.ERROR,
logging.DEBUG if error_code <= 404 else logging.ERROR,
f"UI got request for {request.path}, but it resulted in a {error_code}: {error.name}",
)
return make_response(error_message, error_code)
Expand Down