Skip to content

Commit

Permalink
Update HomeController.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
ArminShoeibi authored Jun 15, 2022
1 parent 221a6bc commit 945e1b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Airbnb.API/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ public HomeController(ILogger<HomeController> logger)
}
public IActionResult Index()
{
// creating a scope because of readability for when having multiple instances of this app with "docker compose up"
// creating a scope because of readability. It is good when you have multiple instances of this app with "docker compose up --scale"
string hostName = Dns.GetHostName();
using (_logger.BeginScope("HostName: {HostName}", hostName))
{
_logger.LogInformation("Handling request");
return Content($"HostName: {hostName}{Environment.NewLine}Timestamp: {DateTimeOffset.Now}");
}
}
}
}

0 comments on commit 945e1b5

Please sign in to comment.