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

Read logs from nginx #44

Closed
jabrena opened this issue Aug 4, 2015 · 4 comments
Closed

Read logs from nginx #44

jabrena opened this issue Aug 4, 2015 · 4 comments

Comments

@jabrena
Copy link

jabrena commented Aug 4, 2015

Hi,

I have just deployed an static application, but I think that exist some kind of problem and I would like to read the logs from the nginx to understand the source of the problem?

Paths:

/home/vcap/app/nginx/logs/access.log
/home/vcap/app/nginx/logs/error.log 

Shell output:

cf logs  StaticWebsiteHelloWorld --recent
Connected, dumping recent logs for app StaticWebsiteHelloWorld in org DevBox / s
pace dev as admin...

2015-08-04T11:44:04.21+0200 [API/0]      OUT Created app with guid f8735892-991d-4b3f-ac71-20fa22887252
2015-08-04T11:44:07.55+0200 [API/0]      OUT Updated app with guid f8735892-991d-4b3f-ac71-20fa22887252 ({"route"=>"96995468-8b8a-4319-944e-961d82138226"})
2015-08-04T11:44:11.43+0200 [DEA/0]      OUT Got staging request for app with id
 f8735892-991d-4b3f-ac71-20fa22887252
2015-08-04T11:44:12.35+0200 [API/0]      OUT Updated app with guid f8735892-991d-4b3f-ac71-20fa22887252 ({"state"=>"STARTED"})
2015-08-04T11:44:12.40+0200 [STG/0]      OUT -----> Downloaded app package (4.0K)
2015-08-04T11:44:12.47+0200 [STG/0]      ERR     Cloning into '/tmp/buildpacks/staticfile-buildpack'...
2015-08-04T11:44:13.78+0200 [STG/0]      OUT     Submodule 'compile-extensions'
(https://github.com/cloudfoundry-incubator/compile-extensions.git) registered for path 'compile-extensions'
2015-08-04T11:44:13.80+0200 [STG/0]      ERR Cloning into 'compile-extensions'...
2015-08-04T11:44:15.10+0200 [STG/0]      OUT Submodule path 'compile-extensions': checked out 'ce9345a9a6e7b00266194cadd18dbef37e791a7b'
2015-08-04T11:44:15.14+0200 [STG/0]      OUT -------> Buildpack version 1.2.1
2015-08-04T11:44:17.07+0200 [STG/0]      ERR grep: Staticfile: No such file or directory
2015-08-04T11:44:17.07+0200 [STG/0]      OUT -----> Using root folder
2015-08-04T11:44:17.07+0200 [STG/0]      OUT -----> Copying project files into public/
2015-08-04T11:44:17.11+0200 [STG/0]      OUT -----> Setting up nginx
2015-08-04T11:44:17.17+0200 [STG/0]      ERR grep: Staticfile: No such file or directory
2015-08-04T11:44:17.75+0200 [STG/0]      OUT -----> Uploading droplet (2.5M)
2015-08-04T11:44:20.15+0200 [DEA/0]      OUT Starting app instance (index 0) with guid f8735892-991d-4b3f-ac71-20fa22887252
2015-08-04T11:44:21.19+0200 [App/0]      OUT     ==> /home/vcap/app/nginx/logs/access.log <==
2015-08-04T11:44:21.19+0200 [App/0]      OUT ==> /home/vcap/app/nginx/logs/error.log <==

Many thanks in advance.

Juan Antonio

@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this. You can view the current status of your issue at: https://www.pivotaltracker.com/story/show/100499736.

@jabrena jabrena changed the title Read logs form nginx Read logs from nginx Aug 4, 2015
@jabrena
Copy link
Author

jabrena commented Aug 4, 2015

Currently, when I try to get access to the application, I receive the following info:

403 Forbidden
nginx

@aemengo
Copy link

aemengo commented Aug 4, 2015

@jabrena Does your app reach the 'running' state? If so, you can access those files on Cloud Foundry via the cf files command. In this case, it would be like: cf files StaticWebsiteHelloWorld app/nginx/logs/access.log. Please let us know if that helps.

@jabrena
Copy link
Author

jabrena commented Aug 5, 2015

Hi @aemengo, yes the application is in running statec:


cf app StaticWEbsiteHelloWorld
Showing health and status for app StaticWebsiteHelloWorld in org DevBox / space
dev as admin...
OK

requested state: started
instances: 1/1
usage: 1G x 1 instances
urls: StaticWebsiteHelloWorld.MY_IP.xip.io
last uploaded: Wed Aug 5 12:28:31 UTC 2015
stack: cflinuxfs2
buildpack: https://github.com/cloudfoundry/staticfile-buildpack

     state     since                    cpu    memory       disk         details

#0   running   2015-08-05 02:28:43 PM   0.0%   3.5M of 1G   5.2M of 1G

Finally I could read the logs and the file system with the notes:

cf files StaticWebsiteHelloWorld app/
Getting files for app StaticWebsiteHelloWorld in org DevBox / space dev as admin
...
OK

StaticWebsite_HelloWorld/                    -
boot.sh                                   1.5K
nginx/                                       -
public/                                      -

Many thanks for the support

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