Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying OPENSHIFT COOKBOOK
  • Table Of Contents Toc
  • Feedback & Rating feedback
OPENSHIFT COOKBOOK

OPENSHIFT COOKBOOK

By : Gulati
3.8 (6)
close
close
OPENSHIFT COOKBOOK

OPENSHIFT COOKBOOK

3.8 (6)
By: Gulati

Overview of this book

If you are a web application developer who wants to use the OpenShift platform to host your next big idea but are looking for guidance on how to achieve this, then this book is the first step you need to take. This is a very accessible cookbook where no previous knowledge of OpenShift is needed.
Table of Contents (14 chapters)
close
close
12
A. Running OpenShift on a Virtual Machine
13
Index

Working with Python application logs

In this recipe, you will learn how to add view and logging to your Python applications. As discussed in Chapter 8, OpenShift for Python Developers, OpenShift Python applications use Apache with mod_wsgi.

Getting ready

This recipe will use the application created in the Creating and deploying Flask web applications using Python and PostgreSQL cartridges recipe in Chapter 8, OpenShift for Python Developers. You can recreate the application using the following command:

$ rhc create-app jobstore python-2.7 postgresql-9.2 --from-code https://github.com/OpenShift-Cookbook/chapter8-jobstore-python-flask.git

How to do it…

Perform the following steps:

  1. Open a new command-line terminal, and navigate to the directory where you have created the Python application.
  2. To view the logs of a Python application, run the following command:
    $ rhc tail --files */log*/python.log
    
  3. By visiting the application URL, you will see the following logs in the rhc tail command output...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech

Create a Note

Modal Close icon
You need to login to use this feature.
notes
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Delete Note

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY