Skip to content
This repository was archived by the owner on Nov 29, 2018. It is now read-only.

Log all searched locations for non existance resources #336

Closed
hishamco opened this issue Mar 4, 2017 · 7 comments
Closed

Log all searched locations for non existance resources #336

hishamco opened this issue Mar 4, 2017 · 7 comments

Comments

@hishamco
Copy link
Contributor

hishamco commented Mar 4, 2017

After the PR #331, me as a developer I expect to log all searched locations for non-exist localization resources
Assume that I add the culture ar, with enabling parent culture fallback, so when the current culture is ar-YE I except the logger logs:

searched for 'Hello' in 'LocalizationSample.Startup' with culture 'ar-YE'.
searched for 'Hello' in 'LocalizationSample.Startup' with culture 'ar'.

instead of log the first message after fallback

/cc @ryanbrandenburg @pranavkm

@Eilon
Copy link
Contributor

Eilon commented Aug 8, 2017

@hishamco are you saying that in 2.0.0 only the first log is written, but not the second log?

@Eilon
Copy link
Contributor

Eilon commented Aug 8, 2017

BTW I think this might be happening because ASP.NET Core isn't the one doing the fallback - it's .NET Core / .NET Framework doing it, and we don't participate in the fallback logic it uses.

@hishamco
Copy link
Contributor Author

hishamco commented Aug 8, 2017

@hishamco are you saying that in 2.0.0 only the first log is written, but not the second log?

Yep

BTW I think this might be happening because ASP.NET Core isn't the one doing the fallback - it's .NET Core / .NET Framework doing it, and we don't participate in the fallback logic it uses.

It would be nice if we have the behavior that I mentioned on the first thread, which is similar to MVC fallback for views

@Eilon my aim here is to write a very useful log, because the localization already fallback to the parent culture

@Eilon
Copy link
Contributor

Eilon commented Aug 8, 2017

Yeah I don't think that ASP.NET Core has any control over that. The .NET fallback implementation will run without ASP.NET Core's knowledge - there's nowhere to inject the logging as far as I know. In particular, there's no way I know of to log things as they happen. You can log it before or after, but I don't think that's nearly as useful because in case there's an error, it won't be clear what triggered the error.

@hishamco
Copy link
Contributor Author

hishamco commented Aug 9, 2017

The current implementation is already write a log when the resource is not found. just we need to write another log, because if the resource isn't found and Fallback is true we are know that we already searched for that resource in the current culture and its parents

@Eilon
Copy link
Contributor

Eilon commented Aug 14, 2017

@hishamco - I thought it's .NET itself that does the fallback of cultures, no? The only fallback that I can find that ASP.NET Core does is to determine which culture to select based on the incoming request's culture (e.g. headers, cookies, etc.). When it comes to doing the resource lookup, I can't find anything that does a meaningful fallback.

@aspnet-hello
Copy link

This issue was moved to dotnet/aspnetcore#2646

@aspnet aspnet locked and limited conversation to collaborators Jan 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants