mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-10-01 01:36:12 -04:00
logger: Use forwarded instead of peer IP address (#3223)
This commit is contained in:
parent
ef3544bac4
commit
985359918f
@ -165,7 +165,10 @@ pub async fn start_lemmy_server() -> Result<(), LemmyError> {
|
||||
};
|
||||
|
||||
App::new()
|
||||
.wrap(middleware::Logger::default())
|
||||
.wrap(middleware::Logger::new(
|
||||
// This is the default log format save for the usage of %{r}a over %a to guarantee to record the client's (forwarded) IP and not the last peer address, since the latter is frequently just a reverse proxy
|
||||
"%{r}a '%r' %s %b '%{Referer}i' '%{User-Agent}i' %T",
|
||||
))
|
||||
.wrap(cors_config)
|
||||
.wrap(TracingLogger::<QuieterRootSpanBuilder>::new())
|
||||
.app_data(Data::new(context))
|
||||
|
Loading…
Reference in New Issue
Block a user