Skip to content

Conversation

@joseluisq
Copy link
Collaborator

@joseluisq joseluisq commented May 1, 2025

Description

This PR fixes an issue (previously an ad-hoc and inconsistent behavior) where SWS was printing INFO level messages at startup despite setting up a higher log level. E.g., WARN or ERROR.

Notice:

For consistency reasons, SWS now won't persistently show server information at startup independently of the log level as it did before. Instead, those info log entries are non-persistent and under the normal server INFO log level.

For example. To show those logs again then use the INFO log level.

static-web-server -p 8787 -d public/ -g info
# 2025-05-01T13:34:11.901636Z  INFO static_web_server::server: static-web-server 2.36.1
# 2025-05-01T13:34:11.901867Z  INFO static_web_server::server: log level: info
# 2025-05-01T13:34:11.901975Z  INFO static_web_server::server: server bound to tcp socket [::]:8787
# 2025-05-01T13:34:11.901995Z  INFO static_web_server::server: runtime worker threads: 8
# 2025-05-01T13:34:11.902006Z  INFO static_web_server::server: runtime max blocking threads: 512
# 2025-05-01T13:34:11.902041Z  INFO static_web_server::server: redirect trailing slash: enabled=true
# 2025-05-01T13:34:11.902076Z  INFO static_web_server::server: ignore hidden files: enabled=false
# 2025-05-01T13:34:11.902086Z  INFO static_web_server::server: disable symlinks: enabled=false
# 2025-05-01T13:34:11.902096Z  INFO static_web_server::server: grace period before graceful shutdown: 0s
# 2025-05-01T13:34:11.902268Z  INFO static_web_server::server: index files: index.html
# 2025-05-01T13:34:11.902374Z  INFO static_web_server::directory_listing: directory listing: enabled=false
# 2025-05-01T13:34:11.902386Z  INFO static_web_server::directory_listing: directory listing order code: 6
# 2025-05-01T13:34:11.902395Z  INFO static_web_server::directory_listing: directory listing format: Html
# 2025-05-01T13:34:11.902451Z  INFO static_web_server::fallback_page: fallback page: enabled=false, value=""
# 2025-05-01T13:34:11.902465Z  INFO static_web_server::health: health endpoint: enabled=false
# 2025-05-01T13:34:11.902498Z  INFO static_web_server::log_addr: log requests with remote IP addresses: enabled=false
# 2025-05-01T13:34:11.902530Z  INFO static_web_server::log_addr: log X-Real-IP header: enabled=false
# 2025-05-01T13:34:11.902541Z  INFO static_web_server::log_addr: log X-Forwarded-For header: enabled=false
# 2025-05-01T13:34:11.902551Z  INFO static_web_server::log_addr: trusted IPs for X-Forwarded-For: all
# 2025-05-01T13:34:11.902610Z  INFO static_web_server::basic_auth: basic authentication: enabled=false
# 2025-05-01T13:34:11.902645Z  INFO static_web_server::maintenance_mode: maintenance mode: enabled=false
# 2025-05-01T13:34:11.902700Z  INFO static_web_server::maintenance_mode: maintenance mode status: 503
# 2025-05-01T13:34:11.902710Z  INFO static_web_server::maintenance_mode: maintenance mode file: ""
# 2025-05-01T13:34:11.902764Z  INFO static_web_server::compression_static: compression static: enabled=false
# 2025-05-01T13:34:11.903069Z  INFO static_web_server::compression: auto compression: enabled=true, formats=deflate,gzip,brotli,zstd, compression level=Default
# 2025-05-01T13:34:11.903082Z  INFO static_web_server::control_headers: cache control headers: enabled=true
# 2025-05-01T13:34:11.903092Z  INFO static_web_server::security_headers: security headers: enabled=false
# 2025-05-01T13:34:11.903631Z  INFO Server::start_server{addr_str="[::]:8787" threads=8}: static_web_server::server: close time.busy=0.00ns time.idle=28.2µs
# 2025-05-01T13:34:11.903667Z  INFO static_web_server::server: http1 server is listening on http://[::]:8787
# 2025-05-01T13:34:11.903678Z  INFO static_web_server::server: press ctrl+c to shut down the server

Related Issue

Resolves #541

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

@semanticdiff-com
Copy link

semanticdiff-com bot commented May 1, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  src/logger.rs  19% smaller
  src/basic_auth.rs  0% smaller
  src/bin/server.rs  0% smaller
  src/compression.rs  0% smaller
  src/compression_static.rs  0% smaller
  src/control_headers.rs  0% smaller
  src/cors.rs  0% smaller
  src/directory_listing.rs  0% smaller
  src/fallback_page.rs  0% smaller
  src/health.rs  0% smaller
  src/log_addr.rs  0% smaller
  src/maintenance_mode.rs  0% smaller
  src/mem_cache/cache.rs  0% smaller
  src/metrics.rs  0% smaller
  src/security_headers.rs  0% smaller
  src/server.rs  0% smaller
  src/settings/mod.rs  0% smaller

@joseluisq joseluisq added v2 v2 release bugfix This is PR fixes a bug labels May 1, 2025
@joseluisq joseluisq merged commit cb19995 into master May 7, 2025
29 of 38 checks passed
@joseluisq joseluisq deleted the make-startup-server-info-non-persistent branch May 7, 2025 23:36
@joseluisq joseluisq added this to the v2.37.0 milestone May 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix This is PR fixes a bug v2 v2 release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

INFO output even on higher log levels

2 participants