WebFaction
Community site: login faq

I'm at a loss here. I've created a model named log.py, which contains:

import logging
logger = logging.getLogger(request.application)
logger.setLevel(logging.DEBUG)

I copied logging.example.conf to my web2py folder and renamed it to logging.conf and added myapp to the end of keys, then added the following code for the handler:

# myapp app handler
[logger_myapp]
level=DEBUG
handlers=consoleHandler,rotatingFileHandler
qualname=web2py.app.myapp
propagate=0

In default.py I've added a couple of logging statements similar to thie:

logger.debug("Entering status_check() - logging test")

When I run this locally, I see a file created at ./web2py/logs/web2py.log. However, when I deploy this same code to my server, I get nothing. I went so far as to create that file manually and chmod 777 the file to see if I had some silly permissions issue, and I see nothing.

I'm running web2py's built in server via a cronjob like this:

@reboot python /home/mike/web2py/web2py.py -i 0.0.0.0 -p 80 -a "<recycle>"

The reason I'm adding the logging is because I was trying to run a subprocess in order to ping a certain set of URL's to check their status upon a page load, using nping, and was having the same problem with that (subprocess runs fine on local machine, but is not running correctly on server).

Ideas and suggestions would be appreciated. Thanks!

Of note, all references to "myapp" above are actually named for the correct application name, not just the text "myapp".

asked 15 Sep '15, 18:24

mikecole79
113
accept rate: 100%

closed 16 Sep '15, 16:32

seanf
12.2k41836

Regarding "I'm running web2py's built in server via a cronjob like this" - I'm assuming that's how you're running it locally. How are you running it on the server?

(15 Sep '15, 22:27) seanf

That's actually what's running on the server. I did some reading and I recall there being some security concerns over using the built in server, but it's an internal corporate server (and a dinky little underpowered thing at that) which is behind a big scary company firewall, so my security concerns are extremely limited for that server, and it seemed far easier to do that than fiddle with trying to get Apache up and configured to do what I wanted it to do.

Locally I just start the server through my IDE when I need it running to validate something then stop it when I'm done working with it.

(15 Sep '15, 22:37) mikecole79

Ok, there are a couple of problems with that:

  • "python" might not be the version of Python that you want/need for your app to work properly.
  • You can't bind to port 80, nor to any other port below 1024 on our servers. Instead, create a 'custom app listening on port' application via our control panel to reserve a port number, and bind to that instead. Attach the custom app to your website in the panel, and our setup will take care of proxying requests for your site to your port.

I don't know if any of that will help your logging problem, but it's worth a shot. Feel free to open a support ticket if you'd like us to take a closer look at what you've got going on the server.

(15 Sep '15, 22:56) seanf

The question has been closed for the following reason "The question is answered, right answer was accepted" by seanf 16 Sep '15, 16:32


Aight, so here's the situation. I'm dumb, ran across a forum with a bunch of good questions on it, and posted a question. I'm not using a webfaction server and didn't even realize that it was a hosting service itself, or anything more than a useful forum. Thus, I'm running on a private server, behind a corporate firewall, and not on one of your servers. So this was my mistake. Just trying to find some answers, and I wasn't getting any responses on StackOverflow.

Sorry for the mistake. Unsure how to close this question.

permanent link

answered 16 Sep '15, 16:25

mikecole79
113
accept rate: 100%

No sweat, I've closed the topic.

(16 Sep '15, 16:32) seanf

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×24
×24
×10
×8
×1

question asked: 15 Sep '15, 18:24

question was seen: 2,032 times

last updated: 16 Sep '15, 16:32

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM