librelist archives

« back to archive

Flask application logfile is not written under Apache deployment

Flask application logfile is not written under Apache deployment

From:
Claudio Sparpaglione
Date:
2013-03-07 @ 10:20
Hi all, 

hope you can help me with this issue.
I coded a Flask app which is writing logs to a local rotating file: no 
problems at all when I run it

via the built-in Flask webserver (logfile is created and written as I 
expect), but when I depoloy it to my Apache 
webserver on Windows the logfile is not written and I can't understand why
- despite this, the app is runnnig fine. 
What is strange is that no logs from my app are written at all to any 
place (event Apache standard logfiles)

I also posted a question on Stack Overflow about this issue, please refer 
to that for details:

    
http://stackoverflow.com/questions/15250396/flask-application-logfile-is-not-written-under-apache-deployment


Thanks in advance!


Claudio Sparpaglione
website | linkedin | twitter

Re: [flask] Flask application logfile is not written under Apache deployment

From:
Claudio Sparpaglione
Date:
2013-03-07 @ 13:17
Ok, I made it: simply moving the logging code from the

  if__name__ =='__main__'

block to a higher scope had the logfile correctly written to the absolute 
path that I gave.
My sin here was to be a Flask noob ;-)
Hope this helps someone!


Claudio



________________________________
 Da: Claudio Sparpaglione <csparpa@yahoo.com>
A: flask@librelist.com 
Inviato: Giovedì 7 Marzo 2013 11:20
Oggetto: [flask] Flask application logfile is not written under Apache deployment
 

Hi all, 

hope you can help me with this issue.
I coded a Flask app which is writing logs to a local rotating file: no 
problems at all when I run it

via the built-in Flask webserver (logfile is created and written as I 
expect), but when I depoloy it to my Apache 
webserver on Windows the logfile is not written and I can't understand why
- despite this, the app is runnnig fine. 
What is strange is that no logs from my app are written at all to any 
place (event Apache standard logfiles)

I also posted a question on Stack Overflow about this issue, please refer 
to that for details:

    
http://stackoverflow.com/questions/15250396/flask-application-logfile-is-not-written-under-apache-deployment


Thanks in advance!


Claudio Sparpaglione
website | linkedin | twitter

Re: [flask] Flask application logfile is not written under Apache deployment

From:
Markus Unterwaditzer
Date:
2013-03-07 @ 12:08
On Thu, Mar 07, 2013 at 02:20:19AM -0800, Claudio Sparpaglione wrote:
>    Hi all, 
>    hope you can help me with this issue.
>    I coded a Flask app which is writing logs to a local rotating file: no
>    problems at all when I run it
>    via the built-in Flask webserver (logfile is created and written as I
>    expect), but when I depoloy it to my Apache 
>    webserver on Windows the logfile is not written and I can't understand why
>    - despite this, the app is runnnig fine. 
>    What is strange is that no logs from my app are written at all to any
>    place (event Apache standard logfiles)
>    I also posted a question on Stack Overflow about this issue, please refer
>    to that for details:
>       
>    
[1]http://stackoverflow.com/questions/15250396/flask-application-logfile-is-not-written-under-apache-deployment
>    Thanks in advance!
>    Claudio Sparpaglione
>    [2]website | [3]linkedin | [4]twitter
> 
> References
> 
>    Visible links
>    1. 
http://stackoverflow.com/questions/15250396/flask-application-logfile-is-not-written-under-apache-deployment
>    2. http://csparpaglione.tk/
>    3. http://it.linkedin.com/in/claudiosparpaglione
>    4. http://twitter.com/csparpa

I've replied on StackOverflow.

-- Markus