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

docker logs not capturing Kestrel output #82

Closed
jdwilly2001 opened this issue Jul 7, 2016 · 3 comments
Closed

docker logs not capturing Kestrel output #82

jdwilly2001 opened this issue Jul 7, 2016 · 3 comments

Comments

@jdwilly2001
Copy link

jdwilly2001 commented Jul 7, 2016

I am trying to configure docker to capture the default ConsoleLogger from Kestrel. When i run the process with -d, I do not see any log messages, i see the standard 'startup' message:

[ec2-user@ip-172-17-45-127 ~]$ docker logs da278803df90
Project MyApp.Web.Core (.NETStandard,Version=v1.6) was previously compiled. Skipping compilation.
Project MyApp.Web (.NETCoreApp,Version=v1.0) was previously compiled. Skipping compilation.
Microsoft.Extensions.Configuration.ConfigurationRoot  <-- Console.WriteLine(config)
Hosting environment: Development
Content root path: /
Now listening on: http://0.0.0.0:5000
Application started. Press Ctrl+C to shut down.

But when requests are made, there are no messages like I get when running the process without docker or with -it

UPDATE: Log messages from ConsoleLogger do not show messages even when running from
docker run -it -P /bin/sh

@naamunds
Copy link
Member

@jdwilly2001 I was unable to repro this. For my web app, I see the ASP.NET logging by default when doing docker logs <container>.

Have you verified that the web requests are successfully going through to your application when it's running in the Docker container? For example, if you go to http://localhost::<host_port> in a web browser on the host machine (where host_port is the host machine's port which is mapped to the container's port being used by the web application, which can be seen with docker ps), does the web application load?

@MichaelSimons
Copy link
Member

@jdwilly2001, were you able to work through this issue? If so, please feel free to close this issue. If not, please provide the information @naamunds requested.

Thanks

@jdwilly2001
Copy link
Author

So this was resolved. I attempted to run the application from / using dotnet run -p /app/MyApp.

However when the boilerplate application loads the appconfig.json, it is looking relative to the run directory.

using the WORKDIR directive in the docker file fixed the issue. I believe it was failing to load the configuration and thus the logging was not properly established.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants