Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Injected ILogger<T> not logging anything #13

Closed
MikePennington opened this issue May 22, 2020 · 1 comment
Closed

Injected ILogger<T> not logging anything #13

MikePennington opened this issue May 22, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@MikePennington
Copy link

I ran dotnet new webapi to generate a new webapi and added a log statement for testing:

        private readonly ILogger<WeatherForecastController> _logger;

        public WeatherForecastController(ILogger<WeatherForecastController> logger)
        {
            _logger = logger;
        }

        [HttpGet]
        public IEnumerable<WeatherForecast> Get()
        {
            _logger.LogError("TESTING");

The statement will log just fine if I run the webapi using dotnet run, but it will not write anything to the logs if I run func start host and also will not log anything when I push the function app up to azure.

@tntwist tntwist self-assigned this May 22, 2020
@tntwist tntwist added the bug Something isn't working label May 22, 2020
@tntwist
Copy link
Owner

tntwist commented May 25, 2020

Thanks again and its also fixed with the new version 😄

Greetings.

@tntwist tntwist closed this as completed May 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants