Skip to content

Commit

Permalink
Update readme, update server logging
Browse files Browse the repository at this point in the history
  • Loading branch information
psidex committed Jul 24, 2023
1 parent d712c00 commit 5736638
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,6 @@ The server provides 2 endpoints, `/` (for your IP) and `/health` (returns 200 wi
```bash
docker run -d --name ipmon-server \
--restart unless-stopped \
-p 8080:8080 \
psidex/ipmon-server:latest
```
8 changes: 6 additions & 2 deletions src/bin/ipmon-server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,14 @@ async fn main() -> std::io::Result<()> {
false => "0.0.0.0",
};

// Log format from here, with real ip instad of peer ip:
// https://docs.rs/actix-web/latest/actix_web/middleware/struct.Logger.html

HttpServer::new(|| {
App::new()
.wrap(Logger::default())
// .wrap(Logger::new("%a %{User-Agent}i"))
.wrap(Logger::new(
"%{r}a \"%r\" %s %b \"%{Referer}i\" \"%{User-Agent}i\" %T",
))
.service(health)
.service(handler)
})
Expand Down

0 comments on commit 5736638

Please sign in to comment.